<template>
  <div class="mapMain">
    <div id="popup1" class="ol-popup" v-drag v-show="popxy">
      <a href="#" @click="closePop" class="popx">x</a>
      <div class="media">
        <div class="media-body">
          <table class="poptable">
            <tbody>
              <tr>
                <th width="25%">要素细类</th>
                <td colspan="2">{{ popdata.ysxl }}</td>
              </tr>
              <tr>
                <th>分区编码</th>
                <td colspan="2">{{ popdata.fqbm }}</td>

              </tr>
              <tr>
                <th>地州/师</th>
                <td colspan="2">{{ popdata.djmc }}</td>

              </tr>
              <tr>
                <th>县市/团</th>
                <td colspan="2">{{ popdata.xmc }}</td>
              </tr>
              <tr>
                <th>自治区/兵团</th>
                <td colspan="2">{{ popdata.smc }}</td>
              </tr>
              <tr>
                <th>管控分区</th>
                <td colspan="2">{{ popdata.hjys }}</td>
              </tr>

              <tr>
                <th>面积</th>
                <td colspan="2">{{ popdata.area }}</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <!--   <div style="margin-top: 5px">
          <el-button type="success" size="mini" style="float: right" round @click="guanKongInfo()">管控信息</el-button>
      </div>-->
    </div>
    <div id="popup2" class="ol-popup" v-drag v-show="popxy1">
      <a href="#" @click="closePop" class="popx">x</a>
      <div class="media">
        <div class="media-body">
          <table class="poptable">
            <tbody>
              <tr>
                <th width="25%">单元编码</th>
                <td colspan="2">{{ pop1data.fqbm }}</td>

              </tr>
              <tr>
                <th>地州/师</th>
                <td colspan="2">{{ pop1data.djmc }}</td>

              </tr>
              <tr>
                <th>县市/团</th>
                <td colspan="2">{{ pop1data.xmc }}</td>
              </tr>
              <tr>
                <th>自治区/兵团</th>
                <td colspan="2">{{ pop1data.smc }}</td>
              </tr>
              <tr>
                <th>单元名称</th>
                <td colspan="2">{{ pop1data.hjys }}</td>
              </tr>

              <tr>
                <th>面积</th>
                <td colspan="2">{{ pop1data.area }}</td>
              </tr>
              <tr>
                <th>备注</th>
                <td colspan="2">{{ pop1data.remakes }}</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
    </div>
    <div id="popup3" class="ol-popup" v-drag v-show="popxy2" style="width: 440px">
      <a href="#" @click="closePop" class="popx">x</a>
      <div class="media">
        <div class="media-body">
          <table class="poptable">
            <tbody>
              <tr>
                <th width="30%">要素细类</th>
                <td colspan="2">{{ popdata2.ysxl }}</td>
              </tr>
              <tr>
                <th>分区编码</th>
                <td colspan="2">{{ popdata2.fqbm }}</td>
              </tr>
              <tr>
                <th>自治区/兵团</th>
                <td colspan="2">{{ popdata2.smc }}</td>
              </tr>
              <tr>
                <th>地州/师</th>
                <td colspan="2">{{ popdata2.djmc }}</td>
              </tr>
              <tr>
                <th>县市/团</th>
                <td colspan="2">{{ popdata2.xmc }}</td>
              </tr>
              <tr>
                <th>河段名称</th>
                <td colspan="2">{{ popdata2.LYMC }}</td>
              </tr>
              <tr>
                <th>流域名称</th>
                <td colspan="2">{{ popdata2.HDMC }}</td>
              </tr>
              <tr>
                <th>控制断面起点经度</th>
                <td colspan="2">{{ popdata2.KZDMQDJD }}</td>
              </tr>
              <tr>
                <th>控制断面起点纬度</th>
                <td colspan="2">{{ popdata2.KZDMQDWD }}</td>
              </tr>
              <tr>
                <th>控制断面终点经度</th>
                <td colspan="2">{{ popdata2.KZDMZDJD }}</td>
              </tr>
              <tr>
                <th>控制断面终点纬度</th>
                <td colspan="2">{{ popdata2.KZDMZDWD }}</td>
              </tr>

              <tr>
                <th colspan="1">面积</th>
                <td colspan="2">{{ popdata2.area }}</td>
              </tr>
            </tbody>
          </table>
        </div>
      </div>
      <!--<div style="margin-top: 5px">
        <el-button type="success" size="mini" style="float: right" round @click="guanKongInfo()">管控信息</el-button>
      </div>-->

    </div>
    <div id="map"></div>
    <div class="warntitle" style="position:absolute;top: 10px;right: 60%">
      <el-alert title="图中边界为工作参考界线，不作为定界依据   " type="warning" show-icon>
      </el-alert>
    </div>
    <div class="warntitle" style="position:absolute;top: 50px;right: 31.9%">
      <el-alert title="研判结果根据项目填报的基本信息及项目空间定位信息分析得出，仅供环境影响评价前期参考使用，不作为最终判定结果" type="warning" show-icon>
      </el-alert>
    </div>
    <div id="toptool">
      <el-select v-model="shiValue" placeholder="请选择定位区划" @change="changeShi">
        <el-option v-for="item in quHua" :key="item.value" :label="item.label" :value="item.value">
        </el-option>
      </el-select>
    </div>
    <div id="toolbar" class=" tool-bar" v-bind:class="{ 'param-container': infoZkTo }"
      style="position: absolute; left:1%;top:8%;z-index: 999;">
      <div id="toolcontrol" style="display: inline-block">
        <el-button @click="infoZkTo = !infoZkTo" type="goon" icon="iconfont icon-gongju" circle></el-button>
      </div>
      <div id="othertool" style="display: inline-block">
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="ceju">测距</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="cemian">测面</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="qingchu">清除</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="yingxiang">{{ yingx }}</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="sy">所有图层</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="dy">单元</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="st">生态</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="shui">水</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="daqi">大气</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="ziran">自然</el-button>
        <el-button v-show="infoZkTo" class="tlb" type="text" size="mini" @click="getshenpi">已归档项目</el-button>
        <!-- <el-select v-model="value" placeholder="请选择">
          <el-option
            v-for="item in options"
            :key="item.value"
            :label="item.label"
            :value="item.value">
          </el-option>
        </el-select>-->
      </div>
    </div>
    <div style="position: absolute; bottom: 1%;left: 33%;z-index: 999;width: 30%;height: 30px;">
      <span class="jwd1" style="font-size: 16px;">经度:{{ jdd }}</span> &nbsp;&nbsp;
      <span class="jwd2" style="font-size: 16px;">纬度:{{ wdd }}</span>
    </div>
    <el-button type="primary" style="position: absolute;bottom: 1%;left: 1%" v-show="tlbtnshow" @click="tuliShow"
      size="medium">显示图例</el-button>
    <el-card class="box-card" style="background-color: #fff;z-index: 999;position: absolute;bottom: 2%;left: 1%"
      v-show="tlshow">
      <div slot="header" class="clearfix">
        <span style="font-size: 18px;color:#4b4e53">图例</span>
        <el-button style="float: right; padding: 3px 0" type="text" @click="closeTl">关闭</el-button>
      </div>
      <div class="text item buttonstyle" style="height: 40px">
        <el-button style="float: left;background-color:rgb(255, 0 ,0);"></el-button>&emsp;<div
          style="float: left;margin-left: 10px;margin-top: -7px;height: 26px"> <span style="height: 16px">生态</span></div>
        <el-button style="float: left;background-color:rgb(28, 220 ,128);margin-left: 105px"></el-button>&emsp;<div
          style="float: left;margin-left: 10px;margin-top: -7px;height: 26px"> <span style="height: 16px">水</span></div>
      </div>
      <div class="text item buttonstyle" style="height: 40px">
        <el-button style="float: left;background-color:rgb(128, 120 ,28);"></el-button>&emsp;<div
          style="float: left;margin-left: 10px;margin-top: -7px;height: 26px"> <span style="height: 16px">大气</span></div>
        <el-button style="float: left;background-color:rgb(228, 110 ,28);margin-left: 105px"></el-button>&emsp;<div
          style="float: left;margin-left: 10px;margin-top: -7px;height: 26px"> <span style="height: 16px">自然资源</span>
        </div>
      </div>
      <div class="text item buttonstyle" style="height: 40px">
        <el-button style="float: left;background-color:rgb(44, 32 ,168);"></el-button>&emsp;<div
          style="float: left;margin-left: 10px;margin-top: -7px;height: 26px"> <span style="height: 16px">优先保护单元</span>
        </div>
        <el-button style="float: left;background-color:rgb(228, 110 ,218);margin-left: 42px"></el-button>&emsp;<div
          style="float: left;margin-left: 10px;margin-top: -7px;height: 26px"> <span style="height: 16px">重点管控单元</span>
        </div>
      </div>
      <div class="text item buttonstyle" style="height: 40px">
        <el-button style="float: left;background-color:rgb(168, 102 ,115)"></el-button>&emsp;<div
          style="float: left;margin-left: 10px;margin-top: -7px;height: 26px"> <span style="height: 16px">一般管控单元</span>
        </div>
      </div>
    </el-card>
    <el-card class="box-card"
      style="background-color: #fff;color: #000000;border-radius: 8px; box-shadow: 0 0 5px #acc4fe !important;overflow:auto;max-height: 99.5%;height: 99.5%;width: 20%;margin-left: 20px"
      v-show="infoZk">
      <div slot="header" class="clearfix">
        <span style="font-size: 22px;color: #000000">智能研判报告</span>
      </div>
      <div class="text item" style="background-color: #E7EEF4;">
        <el-collapse v-model="activeNames">
          <el-collapse-item title="项目基本信息" name="0">
            <div>
              <p>项目名称：{{ projectInfo.name }}</p>
              <p class="projMes" :title="projectInfo.huanPing">环评类别：{{ projectInfo.huanPing }}</p>
              <p class="projMes" :title="projectInfo.chanYe">产业类别：{{ projectInfo.chanYe }} </p>
              <div v-if="this.hzgeometrytype == 'point'">坐标：[{{ projectInfo.zuoBiaoX }}，{{ projectInfo.zuoBiaoY }}]</div>
              <div v-else-if="this.hzgeometrytype == 'line'">
                <p>工程长度：{{ this.baogao.length }} </p>
                <p>起点坐标:[{{ this.baogao.longitude0 }},{{ this.baogao.latitude0 }}]</p>
                <p> 终点坐标:[{{ this.baogao.longitude1 }},{{ this.baogao.latitude1 }}]</p>
              </div>
              <div v-else-if="this.hzgeometrytype == 'reo'">
                <p>工程面积：{{ this.baogao.area }}</p>
                <p>中心点坐标:[{{ this.baogao.longitude0 }},{{ this.baogao.latitude0 }}]</p>
                <!--<p>终点坐标:[{{this.baogao.longitude1}},{{this.baogao.latitude1}}]</p>-->
              </div>
            </div>
          </el-collapse-item>
          <el-collapse-item title="生态保护红线分析" name="1">
            <div>
              <p v-if="hxGuize.length != 0">该项目涉及生态保护红线,属于生态保护红线属性表中:<span style="color: red" v-for="item in hxGuize">
                  -{{ item }} </span></p>
              <p v-else>该项目不涉及生态保护红线</p>
            </div>
          </el-collapse-item>

          <el-collapse-item title="单元管控要求" name="3">
            <div>
              <p>环境管控单元编码：{{ DanYuanFrom.bianMa }} </p>
              <p>环境管控单元名称：{{ DanYuanFrom.name }}</p>
              <p>区划: {{ DanYuanFrom.sheng }}/{{ DanYuanFrom.shi }}/{{ DanYuanFrom.xian }}</p>
              <p>管控单元分类：{{ DanYuanFrom.type }} </p>
              <p>空间布局约束：{{ DanYuanFrom.kongJianYueSu }}</p>
              <p>污染物排放管控：{{ DanYuanFrom.wuRanWu }}</p>
              <p>环境风险防控：{{ DanYuanFrom.huanJingFengXian }}</p>
              <p>资源开发效率要求：{{ DanYuanFrom.ziYuanKaiFa }}</p>
            </div>
          </el-collapse-item>
          <el-collapse-item title="环评类别研判结果" name="4">
            <div>
              <p>产业归属：{{ huanPingFrom.guiShu }} </p>
              <p>分类管理：{{ huanPingFrom.fenLei }} </p>
              <p>分级审批：{{ huanPingFrom.shenPi }} </p>
              <p>团场工业集聚区允许项目：{{ huanPingFrom.tuanChangProj }} </p>
              <p>产业分类：
                <span v-if="huanPingFrom.isYuanqu == 1">工业园区</span>
                <span v-else-if="huanPingFrom.isYuanqu == 2">团场集聚区</span>
                <span v-else-if="huanPingFrom.isYuanqu == 0">除园区和团场集聚区以外的其它区域</span>
                <span v-else></span>
              </p>
            </div>
            <div v-if="huanPingFrom.isYuanqu == 1">
              <p v-if="huanPingFrom.yuanQuResult.length > 0">工业园区研判结果：该项目产业类型符合 <span style="color:red"
                  v-for="item in huanPingFrom.yuanQuResult">{{ item }} </span>的产业定位,可考虑落位于该园区 </p>
              <p v-else>工业园区研判结果：<span style="color:red">该项目没有落地于符合产业定位的园区,请查看下面可落园区</span></p>
              <p>可落园区名称：<span v-for="item in huanPingFrom.yuanQuName">{{ item }} </span> </p>
              <p>可落园区编码：<span v-for="item in huanPingFrom.yuanQuBm">{{ item }} </span> </p>
              <p>园区的所在师团：<span v-for="item in huanPingFrom.yuanQuShiTuan">{{ item }} </span> </p>
              <p>可落园区产业：<span v-for="item in huanPingFrom.yuanQuChanYe">{{ item }} </span> </p>
              <p style="color: red;text-align: center">详见研判报告</p>
            </div>
            <div v-else-if="huanPingFrom.isYuanqu == 2">
              <p v-if="huanPingFrom.yuanQuResult.length > 0">工业园区研判结果：<span style="color:red">通过</span>该项目落地于园区 <span
                  style="color:red" v-for="item in huanPingFrom.yuanQuResult">{{ item }} </span> </p>
              <p v-else>工业园区研判结果：<span v-if="ishxandshui">项目落在生态保护红线或者水环境优先保护区, 故环评类别研判结果:<span
                    style="color: red">禁止</span></span>
                <span v-else>该项目没有落地于生态保护红线或者水环境优先保护区, 故环评类别研判结果:<span style="color: red">通过</span></span>
              </p>
              <p style="color: red;text-align: center">详见研判报告</p>
            </div>
          </el-collapse-item>
          <el-collapse-item title="产业指导结果" name="5">
            <div>
              <p><span style="color: blue">产业结构建议结果：</span>{{ chanYeFrom.zhiDao }} </p>
              <div v-if="chanYeFrom.xiBuDiQu.length != 0"><span style="color: blue">西部地区鼓励产业结果：</span>
                <p v-for="item in chanYeFrom.xiBuDiQu">{{ item }} </p>
              </div>
              <div v-if="chanYeFrom.jinZhiSanGao.length != 0"><span style="color: blue">禁止的三高项目结果：</span>
                <p v-for="item in chanYeFrom.jinZhiSanGao">{{ item }} </p>
              </div>
              <div v-else><span style="color: blue">禁止的三高项目结果:</span>无</div>
            </div>
          </el-collapse-item>
        </el-collapse>
      </div>
      <div class="text item" style="background-color: #E7EEF4;border: 1px dashed  #04F7f9;margin-top: 5px;">
        <!--<img id="tup" src="" width="100%">-->
        <el-tabs v-model="picvalue" @tab-click="picchange">
          <el-tab-pane label="整体出图" name="pic1"><img id="tup" src="" width="100%" crossorigin="Anonymous"></el-tab-pane>
          <el-tab-pane label="单元出图" name="pic2"><img id="tup1" src="" width="100%" crossorigin="Anonymous"></el-tab-pane>
          <el-tab-pane label="生态出图" name="pic3"><img id="tup2" src="" width="100%" crossorigin="Anonymous"></el-tab-pane>
          <el-tab-pane label="水出图" name="pic4"><img id="tup3" src="" width="100%" crossorigin="Anonymous"></el-tab-pane>
          <el-tab-pane label="大气出图" name="pic5"><img id="tup4" src="" width="100%" crossorigin="Anonymous"></el-tab-pane>
          <el-tab-pane label="自然资源出图" name="pic6"><img id="tup5" src="" width="100%"
              crossorigin="Anonymous"></el-tab-pane>
        </el-tabs>
      </div>
      <div class="text item" style="margin-top: 25px;padding-left: 10px">
        <el-button type="success" round style="margin-left: 60%" @click="getBaoGao">生成报告</el-button>
      </div>
    </el-card>
    <el-dialog title="" :visible.sync="addDialogFormVisible" :before-close="handleClose" @close="dialogClose" width="30%"
      center class="addP" top="8vh">
      <div>
        <h2 style="text-align: center">新建项目信息</h2>
      </div>
      <el-form :model="form" ref="addFormRef" :rules="addFormRule">
        <el-form-item label="项目名称" :label-width="formLabelWidth" prop="name">
          <el-input v-model="form.name" autocomplete="off"></el-input>
        </el-form-item>
        <el-form-item label="环评类别" :label-width="formLabelWidth" prop="thirdValue">
          <!--<el-cascader
            v-model="value"
            :options="options"
            style="width: 100%"
            placeholder="请选择管理名录类别"
            @change="handleChange"></el-cascader>-->
          <el-select v-model="firstValue" filterable placeholder="请选择一级名录类别" @change="firstChange" style="width: 92%"
            :popper-append-to-body="false">
            <el-option v-for="item in firstLevel" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, label: item.categoryName }">
            </el-option>
          </el-select>
          <el-select v-model="secondValue" filterable :disabled="secondDisabled" placeholder="请选择二级名录类别"
            :popper-append-to-body="false" @change="secondChange" style="width: 92%;margin-top: 10px">
            <el-option v-for="item in secondLevel" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, label: item.categoryName }">
            </el-option>
          </el-select>
          <el-select v-model="form.thirdValue" filterable :disabled="thirdDisabled" placeholder="请选择三级名录类别"
            :popper-append-to-body="false" @change="thridChange" style="width: 92%;margin-top: 10px">
            <el-option v-for="item in thirdLevel" :key="item.id" :label="item.projectName"
              :value="{ value: item.id, label: item.projectName, guiShu: item.industrialOwnership, fenLei: item.categoryManagement, fenJi: item.gradingApproval, tuanChangProj: item.allowProject, tiaojian: item.allowProject, isYuanqu: item.categoryAttribute, projectCategoryNum: item.projectCategoryNum, categoryCondition: item.categoryCondition }">
              <span :title="item.projectName"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.projectName }}</span>
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="产业类别" :label-width="formLabelWidth" prop="secondChanYeValue">
          <!-- <el-cascader
            v-model="value"
            :options="options"
            style="width: 100%"
            placeholder="请选择产业结构类别"
            ></el-cascader>-->
          <el-select v-model="firstChanYeValue" filterable clearable placeholder="请选择产业结构大类"
            :popper-append-to-body="false" @change="firstChanYeChange" style="width: 92%">
            <el-option v-for="item in firstChanYeLevel" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, label: item.categoryName }">
              <span :title="item.categoryName"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.categoryName }}</span>
            </el-option>
          </el-select>
          <el-select v-model="form.secondChanYeValue" filterable clearable :disabled="secondChanYeDisabled"
            placeholder="请选择产业结构小类" :popper-append-to-body="false" @change="secondChanYeChange"
            style="width: 92%;margin-top: 10px">
            <el-option v-for="item in secondChanYeLevel" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, pop: item.properties, label: item.categoryName }">
              <span :title="item.categoryName"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.categoryName }}</span>

            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="行业类别" :label-width="formLabelWidth" prop="secondChanYeValue">
          <!--<el-cascader
            v-model="value"
            :options="options"
            style="width: 100%"
            placeholder="请选择管理名录类别"
            @change="handleChange"></el-cascader>-->
          <el-select v-model="menleiValue" filterable placeholder="请选择门类" @change="menleiChange" style="width: 92%"
            :popper-append-to-body="false">
            <el-option v-for="item in menleiData" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, label: item.categoryName }">
            </el-option>
          </el-select>
          <el-select v-model="daleiValue" filterable :disabled="daleiDisabled" placeholder="请选择大类"
            :popper-append-to-body="false" @change="daleiChange" style="width: 92%;margin-top: 10px">
            <el-option v-for="item in daleiData" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, label: item.categoryName }">
            </el-option>
          </el-select>
          <el-select v-model="zhongleiValue" filterable :disabled="zhongleiDisabled" placeholder="请选择中类"
            :popper-append-to-body="false" @change="zhongleiChange" style="width: 92%;margin-top: 10px">
            <el-option v-for="item in zhongData" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, label: item.categoryName }"></el-option>
          </el-select>
          <el-select v-model="xiaoleiValue" filterable :disabled="xiaoleiDisabled" placeholder="请选择小类"
            :popper-append-to-body="false" style="width: 92%;margin-top: 10px">
            <el-option v-for="item in xiaoleiData" :key="item.id" :label="item.categoryName"
              :value="{ value: item.id, label: item.categoryName, message: item.message, identificationCode: item.identificationCode, belongIndustrialType: item.belongIndustrialType }">
              <span :title="item.message"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.categoryName }}</span>
            </el-option>
          </el-select>

        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button @click="addDialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="addProject">确 定</el-button>
      </div>
    </el-dialog>
    <el-dialog title="特定类别选择" :visible.sync="guiZedialogVisible" width="30%" :before-close="handleClose" id="teDing">
      <span>您的项目落地于</span><span style="color:red" v-for="item in guiZeForm.name">{{ item }} </span> ,需要选择下面选项：
      <!--  <el-table
        id="guizeInfo"
        :data="guiZeForm.guiZeData"
        style="width: 100%"
       >
        <el-table-column
          prop="content"
          label="冲突类别"
          min-width="12%">
        </el-table-column>
        <el-table-column
          prop="analysisRules"
          label="空间分析及规则"
          min-width="15%">
        </el-table-column>
        <el-table-column
          prop="messageBox"
          label="规则内容"
          min-width="73%"
        >
          <template slot-scope="scope">
            {{scope.row.messageBox}}
          &lt;!&ndash;  <el-tooltip
              class="item"
              effect="dark"
              :content="scope.row.messageBox"
              placement="bottom"
              popper-class="tips"
              style="width: 70%"
            >
              <span v-if="scope.row.messageBox.length >= 100">{{
                scope.row.messageBox
              }}</span>
            </el-tooltip>
            <span v-if="scope.row.messageBox.length < 100">{{
              scope.row.messageBox
            }}</span>&ndash;&gt;
          </template>
        </el-table-column>
      </el-table>-->
      <el-form :model="formTeDing">
        <el-form-item label="落地于生态保护红线:" label-width="240px" v-show="guiZeForm.name.indexOf('生态保护红线') != -1">
          <el-select v-model="formTeDing.hxValue" filterable placeholder="请选择项目类别" @change="hongxianChange"
            style="width: 92%" :popper-append-to-body="false">
            <el-option v-for="item in hxData" :key="item.id" :label="item.name"
              :value="{ value: item.id, label: item.name }">
              <span :title="item.name"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.name }}</span>
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="落地于水源地:" label-width="240px" v-show="guiZeForm.name.indexOf('水源地') != -1">
          <el-select v-model="formTeDing.shuiValue" filterable placeholder="请选择项目类别" @change="sydChange"
            style="width: 92%" :popper-append-to-body="false">
            <el-option v-for="item in shuiYDData" :key="item.id" :label="item.name"
              :value="{ value: item.id, label: item.name }">
              <span :title="item.name"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.name }}</span>
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="落地于湿地自然保护区:" label-width="240px" v-show="guiZeForm.name.indexOf('湿地自然保护区') != -1">
          <el-select v-model="formTeDing.shiDiValue" filterable placeholder="请选择项目类别" @change="sdzrChange"
            style="width: 92%" :popper-append-to-body="false">
            <el-option v-for="item in hxData" :key="item.id" :label="item.name"
              :value="{ value: item.id, label: item.name }">
              <span :title="item.name"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.name }}</span>
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="落地于水产种质资源保护区:" label-width="240px" v-show="guiZeForm.name.indexOf('水产种质资源保护区') != -1">
          <el-select v-model="formTeDing.shuizhongValue" filterable placeholder="请选择项目类别" @change="sczzChange"
            style="width: 92%" :popper-append-to-body="false">
            <el-option v-for="item in hxData" :key="item.id" :label="item.name"
              :value="{ value: item.id, label: item.name }">
              <span :title="item.name"
                style="width: 450px;overflow: hidden; text-overflow: ellipsis; -o-text-overflow: ellipsis; white-space:nowrap;display:block;">{{
                  item.name }}</span>
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <!-- <table  class="table table-bordered table-hover table-striped" style="border: 1px solid #cccccc">
        <thead style="border: 1px solid #cccccc">
        <tr>
          <th style="width: 12%">冲突类别</th>
          <th style="width: 15%">空间分析及规则</th>
          <th style="width: 73%">规则内容</th>
        </tr>
        </thead>
        <tbody style="border: 1px solid #cccccc">
        <tr v-for="item in guiZeForm.guiZeData" :key='item.id'>
          <td>{{item.content}}</td>
          <td>{{item.analysisRules}}</td>
          <td v-text="item.messageBox"></td>
        </tr>
        </tbody>
      </table>-->
      <span slot="footer" class="dialog-footer">
        <el-button type="primary" @click="guizeSure">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="输入线或面的坐标点" :visible.sync="dialogVisibletype" width="20%" :before-close="handleClose" id="many">
      <h3 style="margin-top: -10px;">输入第{{ manyindex }}个点坐标：</h3>
      <div>
        <span style=" color: rgb(165, 177, 173); font-weight: normal;font-size: 14px"> 经度：</span><el-input size="mini"
          v-model="jdu" oninput="value=value.replace(/[^0-9.]/g,'')"
          style="width: 18%;margin-left: 5%;height: 30px"></el-input>°
        <el-input size="mini" v-model="jfen" oninput="value=value.replace(/[^0-9.]/g,'')"
          style="width: 18%;margin-left: 5%;height: 30px"></el-input>′
        <el-input size="mini" v-model="jmiao" oninput="value=value.replace(/[^0-9.]/g,'')"
          style="width: 18%;margin-left: 5%;height: 30px"></el-input>″
      </div>

      <div style="margin-top: 12px">
        <span style=" color: rgb(165, 177, 173); font-weight: normal;font-size: 14px"> 纬度：</span><el-input
          oninput="value=value.replace(/[^0-9.]/g,'')" v-model="wdu"
          style="width: 18%;margin-left: 5%;height: 30px"></el-input>°
        <el-input size="mini" v-model="wfen" oninput="value=value.replace(/[^0-9.]/g,'')"
          style="width: 18%;margin-left: 5%;height: 30px"></el-input>′
        <el-input size="mini" v-model="wmiao" oninput="value=value.replace(/[^0-9.]/g,'')"
          style="width: 18%;margin-left: 5%;height: 30px"></el-input>″
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="dialogVisibletype = false">取 消</el-button>
        <el-button type="primary" @click="nextOne">下一个</el-button>
        <el-button type="primary" @click="over">结 束</el-button>
      </div>
    </el-dialog>
    <el-dialog :visible.sync="nenghaoDialogFormVisible" :before-close="handleClose" @close="dialogClose2" width="50%"
      center class="nenghao" top="8vh">
      <div>
        <h2 style="text-align: center">能耗分析</h2>
      </div>
      <el-form v-for="(item, index) in nenghaoData"  :model="item" ref="addFormRef2" :rules="nenghaoFormRule"
        :inline="true" style="background-color: #F7F7F7;margin-bottom: 20px">
        <div style="padding-left: 4%;margin-bottom: 10px">
          <img src="../../assets/img/imge/书签.png">
          <el-tooltip class="item" effect="dark" content="删除整个产品" placement="bottom">
            <img src="../../assets/img/imge/删除.png" style="margin-left: 90%;cursor: pointer"
              @click="removeChanping(item)">
          </el-tooltip>
        </div>
        <el-form-item label="产品" prop="chanpingName">
          <el-select v-model="item.chanpingName" filterable placeholder="请选择产品" style="width: 92%"
            @change="chanpingChange($event, item)">
            <el-option v-for="itemcp in chanpingData" :key="itemcp.id"
              :label="itemcp.productName + '(' + itemcp.serialNum + ')'"
              :value="{ value: itemcp.id, label: itemcp.productName, itemcp: itemcp }">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="数量" prop="chanpingNum">
          <el-input v-model="item.chanpingNum"></el-input>
        </el-form-item>
        <!--  <el-form-item label="分级判定标准:" prop="chanpingName" >
          <span style="color: #34E6B6;font-size: 16px">50000 </span >(吨标煤)
        </el-form-item>-->
        <div class="demo-input-suffix" style="padding-left: 20px">
          <span style="font-size: 16px;">分析结果---按单位产品能耗限额估算标煤量（吨）：</span>
          <span style="color:#34E6B6">{{ item.chanpingValue * item.chanpingNum / item.estimateAmount }}</span>
        </div>
        <el-divider>消费量(入厂)物质</el-divider>
        <el-form-item label="种类:" style="margin-left: 20px">
          <el-tag style="font-size: 14px;">耗能工质</el-tag>
          <!-- <el-select v-model="item2.type" filterable placeholder="请选择种类"  style="width: 92%" @change="zhongleiChange" >
              <el-option
                v-for="itemZl in zhongleiData"
                :key="itemZl.id"
                :label="itemZl.categoryName"
                :value="{value:itemZl.id,label:itemZl.categoryName}">
              </el-option>
            </el-select>-->
          <el-tooltip class="item" effect="dark" content="添加该类物质" placement="bottom">
            <el-button icon="el-icon-plus" circle size="mini" style="margin-left: 5px;margin-top: 3px;color: #34E6B6"
              @click="addWuziHaoneng(item)"> </el-button>
          </el-tooltip>
        </el-form-item>
        <div style="margin-top: -25px">
          <div v-for="(item2, index2) in item.haonengwuziData" style="margin-top: -5px">
            <el-form-item label="物质" :rules="{ required: true, message: '请选择物质', trigger: 'blur' }"
              style="margin-left: 200px">
              <el-select v-model="item2.name" filterable placeholder="请选择物质" style="width: 92%"
                @change="wuziChange($event, item2)">
                <el-option v-for="itemWz in zlwuziData1" :key="itemWz.id"
                  :label="itemWz.substance + '(' + itemWz.substanceUnit + ')'"
                  :value="{ value: itemWz.id, label: itemWz.substance, item: itemWz }">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="用量" :rules="{ required: true, message: '请输入数量', trigger: 'blur' }">
              <el-input v-model="item2.num"></el-input>
            </el-form-item>
            <el-tooltip class="item" effect="dark" content="删除该行物质" placement="bottom">
              <el-button icon="el-icon-minus" circle size="small" style="margin-left: -10px;margin-top: 3px"
                @click="removeWuzihaoneng(item, item2)"> </el-button>
            </el-tooltip>
          </div>
        </div>
        <el-form-item label="种类:" style="margin-left: 20px">
          <el-tag style="font-size: 14px;">各种能源</el-tag>
          <!-- <el-select v-model="item2.type" filterable placeholder="请选择种类"  style="width: 92%" @change="zhongleiChange" >
             <el-option
               v-for="itemZl in zhongleiData"
               :key="itemZl.id"
               :label="itemZl.categoryName"
               :value="{value:itemZl.id,label:itemZl.categoryName}">
             </el-option>
           </el-select>-->
          <el-tooltip class="item" effect="dark" content="添加该类物质" placement="bottom">
            <el-button icon="el-icon-plus" circle size="mini" style="margin-left: 5px;margin-top: 3px;color: #34E6B6"
              @click="addWuzinengyuan(item)"> </el-button>
          </el-tooltip>
        </el-form-item>
        <div style="margin-top: -25px">
          <div v-for="(item2, index2) in item.nengyuanwuziData" style="margin-top: -5px">
            <el-form-item label="物质" :rules="{ required: true, message: '请选择物质', trigger: 'blur' }"
              style="margin-left: 200px">
              <el-select v-model="item2.name" filterable placeholder="请选择物质" style="width: 92%"
                @change="wuziChange($event, item2)">
                <el-option v-for="itemWz in zlwuziData2" :key="itemWz.id"
                  :label="itemWz.substance + '(' + itemWz.substanceUnit + ')'"
                  :value="{ value: itemWz.id, label: itemWz.substance, item: itemWz }">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="用量" :rules="{ required: true, message: '请输入数量', trigger: 'blur' }">
              <el-input v-model="item2.num"></el-input>
            </el-form-item>
            <el-tooltip class="item" effect="dark" content="删除该行物质" placement="bottom">
              <el-button icon="el-icon-minus" circle size="small" style="margin-left: -10px;margin-top: 3px"
                @click="removeWuzinengyuan(item, item2)"> </el-button>
            </el-tooltip>
          </div>
        </div>
        <el-form-item label="种类:" style="margin-left: 20px">
          <el-tag style="font-size: 14px;">电力和热力</el-tag>
          <!-- <el-select v-model="item2.type" filterable placeholder="请选择种类"  style="width: 92%" @change="zhongleiChange" >
             <el-option
               v-for="itemZl in zhongleiData"
               :key="itemZl.id"
               :label="itemZl.categoryName"
               :value="{value:itemZl.id,label:itemZl.categoryName}">
             </el-option>
           </el-select>-->
          <el-tooltip class="item" effect="dark" content="添加该类物质" placement="bottom">
            <el-button icon="el-icon-plus" circle size="mini" style="margin-left: 5px;margin-top: 3px;color: #34E6B6"
              @click="addWuziredian(item)"> </el-button>
          </el-tooltip>
        </el-form-item>
        <div style="margin-top: -25px">
          <div v-for="(item2, index2) in item.redianwuziData" style="margin-top: -5px">
            <el-form-item label="物质" :rules="{ required: true, message: '请选择物质', trigger: 'blur' }"
              style="margin-left: 200px">
              <el-select v-model="item2.name" filterable placeholder="请选择物质" style="width: 92%"
                @change="wuziChange($event, item2)">
                <el-option v-for="itemWz in zlwuziData3" :key="itemWz.id"
                  :label="itemWz.substance + '(' + itemWz.substanceUnit + ')'"
                  :value="{ value: itemWz.id, label: itemWz.substance, item: itemWz }">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="用量" :rules="{ required: true, message: '请输入数量', trigger: 'blur' }">
              <el-input v-model="item2.num"></el-input>
            </el-form-item>
            <el-tooltip class="item" effect="dark" content="删除该行物质" placement="bottom">
              <el-button icon="el-icon-minus" circle size="small" style="margin-left: -10px;margin-top: 3px"
                @click="removeWuziredian(item, item2)"> </el-button>
            </el-tooltip>
          </div>
        </div>
        <!-- <div style="text-align: center;">
          <el-button @click="addwuzi(item)" round icon="el-icon-circle-plus-outline"  size="small">新增消费量(入厂)</el-button>
        </div>-->
        <el-divider>外送量(出厂)物质</el-divider>
        <el-form-item label="种类:" style="margin-left: 20px">
          <el-tag style="font-size: 14px;">各种能源</el-tag>
          <!-- <el-select v-model="item2.type" filterable placeholder="请选择种类"  style="width: 92%" @change="zhongleiChange" >
               <el-option
                 v-for="itemZl in zhongleiData"
                 :key="itemZl.id"
                 :label="itemZl.categoryName"
                 :value="{value:itemZl.id,label:itemZl.categoryName}">
               </el-option>
             </el-select>-->
          <el-tooltip class="item" effect="dark" content="添加该类物质" placement="bottom">
            <el-button icon="el-icon-plus" circle size="mini" style="margin-left: 5px;margin-top: 3px;color: #34E6B6"
              @click="addwuzijiannengyuan(item)"> </el-button>
          </el-tooltip>
          <!--  <el-select v-model="item3.type" filterable placeholder="请选择种类"  style="width: 92%" @change="zhongleiChange" >
              <el-option
                v-for="item in zlwuziDataJian"
                :key="item.id"
                :label="item.categoryName"
                :value="{value:item.id,label:item.categoryName}">
              </el-option>
            </el-select>-->
        </el-form-item>
        <div style="margin-top: -25px">
          <div v-for="(item3, index3) in item.xiaohaoDatanengyuan" style="margin-top: -5px">
            <el-form-item label="物质" :rules="{ required: true, message: '请选择物质', trigger: 'blur' }"
              style="margin-left: 200px">
              <el-select v-model="item3.name" filterable placeholder="请选择物质" style="width: 92%"
                @change="wuziChange($event, item3)">
                <el-option v-for="itemWz2 in zlwuziData2" :key="itemWz2.id"
                  :label="itemWz2.substance + '(' + itemWz2.substanceUnit + ')'"
                  :value="{ value: itemWz2.id, label: itemWz2.substance, item: itemWz2 }">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="用量" :rules="{ required: true, message: '请输入数量', trigger: 'blur' }">
              <el-input v-model="item3.num"></el-input>
            </el-form-item>
            <el-tooltip class="item" effect="dark" content="删除该行物质" placement="bottom">
              <el-button icon="el-icon-minus" circle size="small" style="margin-left: -10px;margin-top: 3px"
                @click="removeWuzi2nengyuan(item, item3)"> </el-button>
            </el-tooltip>
          </div>
        </div>
        <el-form-item label="种类:" style="margin-left: 20px">
          <el-tag style="font-size: 14px;">热力和电力</el-tag>
          <!-- <el-select v-model="item2.type" filterable placeholder="请选择种类"  style="width: 92%" @change="zhongleiChange" >
             <el-option
               v-for="itemZl in zhongleiData"
               :key="itemZl.id"
               :label="itemZl.categoryName"
               :value="{value:itemZl.id,label:itemZl.categoryName}">
             </el-option>
           </el-select>-->
          <el-tooltip class="item" effect="dark" content="添加该类物质" placement="bottom">
            <el-button icon="el-icon-plus" circle size="mini" style="margin-left: 5px;margin-top: 3px;color: #34E6B6"
              @click="addwuzijianredian(item)"> </el-button>
          </el-tooltip>
          <!--  <el-select v-model="item3.type" filterable placeholder="请选择种类"  style="width: 92%" @change="zhongleiChange" >
              <el-option
                v-for="item in zlwuziDataJian"
                :key="item.id"
                :label="item.categoryName"
                :value="{value:item.id,label:item.categoryName}">
              </el-option>
            </el-select>-->
        </el-form-item>
        <div style="margin-top: -25px">
          <div v-for="(item3, index3) in item.xiaohaoDataredian" style="margin-top: -5px">
            <el-form-item label="物质" :rules="{ required: true, message: '请选择物质', trigger: 'blur' }"
              style="margin-left: 200px">
              <el-select v-model="item3.name" filterable placeholder="请选择物质" style="width: 92%"
                @change="wuziChange($event, item3)">
                <el-option v-for="itemWz2 in zlwuziData3" :key="itemWz2.id"
                  :label="itemWz2.substance + '(' + itemWz2.substanceUnit + ')'"
                  :value="{ value: itemWz2.id, label: itemWz2.substance, item: itemWz2 }">
                </el-option>
              </el-select>
            </el-form-item>
            <el-form-item label="用量" :rules="{ required: true, message: '请输入数量', trigger: 'blur' }">
              <el-input v-model="item3.num"></el-input>
            </el-form-item>
            <el-tooltip class="item" effect="dark" content="删除该行物质" placement="bottom">
              <el-button icon="el-icon-minus" circle size="small" style="margin-left: -10px;margin-top: 3px"
                @click="removeWuzi2redian(item, item3)"> </el-button>
            </el-tooltip>
          </div>
        </div>
        <!-- <div style="text-align: center">
          <el-button @click="addwuzijian(item)" round icon="el-icon-circle-plus-outline"  size="small">新增外送量(出厂)</el-button>
        </div>-->
      </el-form>
      <div style="text-align: center;color: #34E6B6;font-size: 18px">
        <i class="el-icon-circle-plus-outline"></i> <a @click="addchanping()">新增产品</a>
      </div>
      <div slot="footer" class="dialog-footer">
        <el-button @click="nenghaoDialogFormVisible = false">取 消</el-button>
        <el-button type="primary" @click="nenghaofenxi">确 定</el-button>
      </div>
      <div class="demo-input-suffix">
        <span style="font-size: 16px;color:#34E6B6"><span style="color: red">(折标系数法估算)</span>分析结果：</span>
        <el-table :data="fenxiresult" style="width: 100%">
          <el-table-column prop="nenghao" label="能耗" width="180">
          </el-table-column>
          <el-table-column prop="dangliang" label="当量值" width="180">
          </el-table-column>
          <el-table-column prop="dengjia" label="等价值" width="180">
          </el-table-column>
          <!-- <el-table-column
            prop="biaozhun"
            label="分级判断标准">
          </el-table-column>-->
          <el-table-column prop="unit" label="单位">
          </el-table-column>
        </el-table>
        <span style="color: red">(准入值估算)</span>按单位产品能耗限额估算标煤量总计（吨）:<span style="color: red">{{ zhunruzhi }}</span>
      </div>
    </el-dialog>
    <el-dialog title="手动新增物质" :visible.sync="nenghaoDialogFormVisibleAdd" :before-close="handleClose"
      @close="editdialogClose" width="25%" center>
      <el-form ref="addWzFormRef" :model="addWzForm" label-width="140px" :rules="addFormRuleWz">
        <el-form-item label="种类" prop="parentId">
          <el-select v-model="addWzForm.parentId" filterable placeholder="请选择种类" style="width: 98%">
            <el-option v-for="itemZl in zhongleiData" :key="itemZl.id" :label="itemZl.categoryName"
              :value="{ value: itemZl.id, label: itemZl.categoryName }">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="物质名称" prop="substance">
          <el-input v-model="addWzForm.substance"></el-input>
        </el-form-item>
        <el-form-item label="物质单位" prop="substanceUnit">
          <el-select v-model="addWzForm.substanceUnit" filterable placeholder="请选择物质单位" style="width: 98%">
            <el-option v-for="item in wuzhiunitData" :key="item.value" :label="item.label" :value="{ value: item.value }">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="平均低位发热量" prop="lowCalorific">
          <el-input v-model="addWzForm.lowCalorific"></el-input>
        </el-form-item>
        <el-form-item label="低位发热量单位" prop="lowCalorificUnit">
          <el-select v-model="addWzForm.lowCalorificUnit" filterable placeholder="请选择低位发热量单位" style="width: 98%">
            <el-option v-for="item in diweifareliangunitData" :key="item.value" :label="item.label"
              :value="{ value: item.value }">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="折标系数" prop="conversionCoefficient">
          <el-input v-model="addWzForm.conversionCoefficient"></el-input>
        </el-form-item>
        <el-form-item label="折标系数单位" prop="conversionCoefficientUnit">
          <el-select v-model="addWzForm.conversionCoefficientUnit" filterable placeholder="请选择折标系数单位" style="width: 98%">
            <el-option v-for="item in zhebianxishuData" :key="item.value" :label="item.label"
              :value="{ value: item.value }">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="标煤低位发热量" prop="standardCoal">
          <el-input v-model="addWzForm.standardCoal" :disabled="true"></el-input>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button round type="goon" size="medium" @click="nenghaoDialogFormVisibleAdd = false">取 消</el-button>
        <el-button round type="goon" size="medium" @click="addWuzi">确 定</el-button>
      </span>
    </el-dialog>
    <el-dialog title="手动新增产品" :visible.sync="nenghaoDialogFormVisibleAddcp" :before-close="handleClose"
      @close="editdialogClose2" width="25%" center>
      <el-form ref="addCpFormRef" :model="addCpForm" label-width="140px" :rules="addFormRuleCp">
        <el-form-item label="产品名称" prop="productName">
          <el-input v-model="addCpForm.productName"></el-input>
        </el-form-item>
        <el-form-item label="指标名称" prop="indexName">
          <el-input v-model="addCpForm.indexName"></el-input>
        </el-form-item>
        <el-form-item label="指标单位" prop="indexUnit">
          <el-select v-model="addCpForm.indexUnit" filterable placeholder="请选择指标单位" style="width: 98%">
            <el-option v-for="item in zhibiaounitData" :key="item.value" :label="item.label"
              :value="{ value: item.value }">
            </el-option>
          </el-select>
        </el-form-item>
        <el-form-item label="准入值" prop="admittanceValue">
          <el-input v-model="addCpForm.admittanceValue"></el-input>
        </el-form-item>
        <el-form-item label="折标系数" prop="estimateAmount">
          <el-select v-model="addCpForm.estimateAmount" filterable placeholder="请选择折标系数" style="width: 98%">
            <el-option v-for="item in zhebiaoData" :key="item.value" :label="item.label" :value="{ value: item.value }">
            </el-option>
          </el-select>
        </el-form-item>
      </el-form>
      <span slot="footer" class="dialog-footer">
        <el-button round type="goon" size="medium" @click="nenghaoDialogFormVisibleAddcp = false">取 消</el-button>
        <el-button round type="goon" size="medium" @click="addChanping">确 定</el-button>
      </span>
    </el-dialog>
  </div>
</template>

<script>
import Viewer from 'viewerjs'
import '../../../node_modules/viewerjs/dist/viewer.css'
import eventBus from '../../assets/js/eventBus'
import "../../assets/css/ol1.css";
import "../../assets/css/ol2.css";
import Map from 'ol/Map';
import View from 'ol/View';
import TileLayer from 'ol/layer/Tile'
import * as control from 'ol/control';
import { Logo, TileSuperMapRest, Label } from '@supermap/iclient-ol';
import { ThemeStyle } from '@supermap/iclient-common';
import Polygon from 'ol/geom/Polygon';
import Point from 'ol/geom/Point';
import { QueryBySQLParameters, QueryService, QueryByGeometryParameters, GetFeaturesByBufferParameters, GetFeaturesByGeometryParameters, FeatureService, GetFeaturesBySQLParameters } from '@supermap/iclient-ol';
import GeoJSON from 'ol/format/GeoJSON';
import VectorSource from 'ol/source/Vector';
import VectorLayer from 'ol/layer/Vector';
import Style from 'ol/style/Style';
import Stroke from 'ol/style/Stroke'
import Fill from 'ol/style/Fill';
import Icon from 'ol/style/Icon';
import Overlay from 'ol/Overlay';
import CircleStyle from 'ol/style/Circle';
import Feature from 'ol/Feature';
import Text from 'ol/style/Text';
import LineString from 'ol/geom/LineString';
import MultiLineString from 'ol/geom/MultiLineString';
import MultiPolygon from 'ol/geom/MultiPolygon';
import Circle from 'ol/geom/Circle';
import Draw from 'ol/interaction/Draw';
import * as olSphere from 'ol/sphere';
import Observable from 'ol/Observable';
import { unByKey } from 'ol/Observable';
import * as olExtent from 'ol/extent';
import ImageLayer from 'ol/layer/Image';
import { transform } from 'ol/proj';
import WMTS from 'ol/source/WMTS'
import * as olProj from 'ol/proj';
import WMTSTileGrid from 'ol/tilegrid/WMTS';
import Docxtemplater from 'docxtemplater'
import PizZip from 'pizzip'
import JSZipUtils from 'jszip-utils'
import { saveAs } from 'file-saver'
import ImageModule from 'docxtemplater-image-module-free';
var map, hxLayer, dxLayer, dxLayer2, sxLayer, yxLayer, zdLayer, ybLayer, selectLayer, hxSource, dxSource, dxSource2, sxSource, yxSource, zdSource, ybSource, bufferSource, selectSouce, yuanLayer, yuanSource;
var tdtslLayer, tdtbqLayer, tdtyxLayer, tdtyxzjLayer, bufferLayer, stbqSource, stbqLayer, shuibqSource, shuibqLayer, daqibqSource, daqibqLayer, ziranbqSource, ziranbqLayer, yxdybqLayer, ybdybqLayer, zddybqLayer, yxdybqSource, ybdybqSource, zddybqSource;
var popO, pop1, pop2;
var draw;
var zhuangtai = 0;
var sketch;
var click = false;
var output = 0;
var lastPolygonLabelFeature; //记录上一个面标注要素
var lastLengthLabelFeature;
var lastCircleLabelFeature;
var pSource = new VectorSource();
var pLayer = new VectorLayer({
  source: pSource,
  style: new Style({
    image: new Icon(({
      src: require('../../assets/img/markerbig_select.png')
    }))
  })
});
var source = new VectorSource();
var vector = new VectorLayer({
  source: source,
  style: new Style({
    fill: new Fill({ //面的填充颜色
      color: 'rgba(255, 0, 0, 0.1)'
    }),
    stroke: new Stroke({
      color: 'rgb(73,178,221)',
      width: 3
    }),
    image: new CircleStyle({
      radius: 3,
      stroke: new Stroke({
        color: 'rgba(255, 0, 0,1)',
        width: 3
      }),
      fill: new Fill({
        color: 'rgba(255,255,255)'
      })
    })
  })
});
var source1 = new VectorSource();
var vector1 = new VectorLayer({
  source: source1,
  style: new Style({
    fill: new Fill({ //面的填充颜色
      color: 'rgba(255, 0, 0, 0.1)'
    }),
    stroke: new Stroke({
      color: 'rgb(255,116,3)',
      width: 2
    }),
    image: new CircleStyle({
      radius: 3,
      stroke: new Stroke({
        color: 'rgba(255, 0, 0,1)',
        width: 2
      }),
      fill: new Fill({
        color: 'rgba(255,255,255)'
      })
    })
  })
});
var createLabelStyle = function (feature) {
  return new Style({
    text: new Text({
      //位置
      textAlign: 'center',
      //基准线
      textBaseline: 'middle',
      //文字样式
      font: 'normal 12px 微软雅黑',
      //文本内容
      text: feature.get('name'),
      backgroundStroke: new Stroke({
        color: '#AAAAAA',
        width: 2
      }),
      backgroundFill: new Fill({
        color: '#AAAAAA'
      }),
      padding: [1, 3, 0, 3],
      //文本填充样式（即文字颜色）
      fill: new Fill({
        color: '#FFFFFF'
      }),
    }),

  });
};
var createguojiaStyle = function (feature) {
  return new Style({
    text: new Text({
      //位置
      textAlign: 'center',
      //基准线
      textBaseline: 'middle',
      //文字样式
      font: 'normal 12px 微软雅黑',
      //文本内容
      text: feature.get('name'),
      backgroundStroke: new Stroke({
        color: '#3ce7bf',
        width: 2
      }),
      offsetY: 23,
      backgroundFill: new Fill({
        color: '#3ce7bf'
      }),
      padding: [1, 3, 0, 3],
      //文本填充样式（即文字颜色）
      fill: new Fill({
        color: '#FFFFFF'
      }),
    }),
    image: new Icon(({
      src: require('../../assets/img/marker-cheng.png')
    }))
  });
};
var pointerMoveHandler = function (evt) {
  if (evt.dragging) {
    return;
  }
  var Coord;
  if (sketch) {
    var geom = sketch.getGeometry();
    if (geom instanceof Polygon) {
      if (lastPolygonLabelFeature) {   //鼠标移动 不停的添加和删除
        source.removeFeature(lastPolygonLabelFeature);
      }
      Coord = geom.getInteriorPoint().getCoordinates();    //新建一个要素ol.Feature
      var newFeature = new Feature({
        geometry: new Point(Coord), //几何信息
        name: output
      });
      lastPolygonLabelFeature = newFeature;
      newFeature.setStyle(createLabelStyle(newFeature, 0, 0));
      source.addFeature(newFeature);
    } else if (geom instanceof LineString) {
      if (lastLengthLabelFeature) {   //鼠标移动 不停的添加和删除
        source.removeFeature(lastLengthLabelFeature);
      }
      Coord = geom.getLastCoordinate();  //新建一个要素ol.Feature
      var newFeature = new Feature({
        geometry: new Point(Coord), //几何信息
        name: output
      });
      lastLengthLabelFeature = newFeature;
      newFeature.setStyle(createLabelStyle(newFeature, 35, -10));
      source.addFeature(newFeature);
    } else if (geom instanceof Circle) {
      if (lastCircleLabelFeature) {
        source1.removeFeature(lastCircleLabelFeature);
      }
      Coord = geom.getLastCoordinate();  //新建一个要素ol.Feature
      var newFeature = new Feature({
        geometry: new Point(Coord), //几何信息
        name: output
      });
      lastCircleLabelFeature = newFeature;
      newFeature.setStyle(createLabelStyle(newFeature, 35, -10));
      source1.addFeature(newFeature);
    }  //设置要素样式

  }
};
var formatLength = function (line) {
  var length = olSphere.getLength(line, {
    projection: 'EPSG:4326'
  });
  var output;
  if (length > 100) {
    output = (Math.round(length / 1000 * 100) / 100) + ' ' + '千米';
  } else {
    output = (Math.round(length * 100) / 100) +
      ' ' + '米';
  }
  return output;
};
var formatArea = function (polygon) {
  var area = olSphere.getArea(polygon, {
    projection: 'EPSG:4326'
  });
  var output;
  if (area > 10000) {
    output = (Math.round(area / 1000000 * 100) / 100) +
      ' ' + '平方千米';
  } else {
    output = (Math.round(area * 100) / 100) +
      ' ' + '平方米';
  }
  return output;
};
var createTuanStyle = function (feature) {
  return new Style({
    text: new Text({
      //位置
      textAlign: 'center',
      //基准线
      textBaseline: 'middle',
      //文字样式
      font: 'normal 13px 微软雅黑',
      //文本内容
      text: feature.get('name'),
      backgroundStroke: new Stroke({
        color: '#00BBFF',
        width: 2
      }),
      backgroundFill: new Fill({
        color: '#00BBFF'
      }),
      padding: [1, 3, 0, 3],
      //文本填充样式（即文字颜色）
      fill: new Fill({
        color: '#ffffff'
      }),

    })
  });
};
var createShiStyle = function (feature) {
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      font: 'normal 15px 微软雅黑',
      text: feature.get('name'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#0099ff'
      }),
      fill: new Fill({
        color: '#ffffff'
      }),
    })
  });
};
var createStStyle = function (feature) {
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      font: 'normal 15px 微软雅黑',
      text: feature.get('HJYSGKFQMC'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#FF0000'
      }),
      fill: new Fill({
        color: '#000000'
      }),
    })
  });
};
var createshuiStyle = function (feature) {
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      font: 'normal 15px 微软雅黑',
      text: feature.get('HJYSGKFQMC'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#FBD12A'
      }),
      fill: new Fill({
        color: '#ffffff'
      }),
    })
  });
};
var createdaqiStyle = function (feature) {
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      overflow: true,
      font: 'normal 15px 微软雅黑',
      text: feature.get('HJYSGKFQMC'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#960453'
      }),
      fill: new Fill({
        color: '#ffffff'
      }),
    })
  });
};
var createziranStyle = function (feature) {
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      font: 'normal 15px 微软雅黑',
      text: feature.get('HJYSGKFQMC'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#6ACD06'
      }),
      fill: new Fill({
        color: '#ffffff'
      }),
    })
  });
};
var createyxdyStyle = function (feature) {
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      font: 'normal 15px 微软雅黑',
      text: feature.get('HJYSGKFQMC'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#FFD700',
      }),
      fill: new Fill({
        color: '#ffffff'
      }),
    })
  });
};
var createzddyStyle = function (feature) {
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      overflow: true,
      font: 'normal 15px 微软雅黑',
      text: feature.get('HJYSGKFQMC'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#9400D3',
      }),
      fill: new Fill({
        color: '#ffffff'
      }),
    })
  });
};
var createybdyStyle = function (feature) {
  console.log(feature.get('HJYSGKFQMC'))
  return new Style({
    text: new Text({
      textAlign: 'center',
      textBaseline: 'bottom',
      font: 'normal 15px 微软雅黑',
      text: feature.get('HJYSGKFQMC'),
      padding: [1, 5, 0, 5],
      backgroundFill: new Fill({
        color: '#FF00FF',
      }),
      fill: new Fill({
        color: '#ffffff'
      }),
    })
  });
};
var gjSource = new VectorSource();
var gjLayer = new VectorLayer({
  source: gjSource,
  style: new Style({
    image: new Icon(({
      src: require('../../assets/img/marker-cheng.png')
    }))
  })
});
var loading;
var projection = olProj.get('EPSG:4326');
var projectionExtent = projection.getExtent();
var size = olExtent.getWidth(projectionExtent) / 256;
var resolutions = new Array(19);
var matrixIds = new Array(19);
for (var z = 0; z < 19; z++) {
  // generate resolutions and matrixIds arrays for this WMTS
  //resolutions[z] = size / Math.pow(2, z);
  matrixIds[z] = z;
}
resolutions = [1.40625, 0.703125, 0.3515625, 0.17578125, 0.087890625, 0.0439453125, 0.02197265625, 0.010986328125, 0.0054931640625, 0.00274658203125, 0.001373291015625, 0.0006866455078125, 0.00034332275390625, 0.000171661376953125,
  0.0000858306884765625, 0.00004291534423828125, 0.000021457672119140625, 0.000010728836059570312, 0.000005364418029785156, 0.000002682209014892578, 0.000001341104507446289
];
var webKey = '529b5a0e294683ef3fad2c0a618cd084';
export default {
  name: 'showCusMap',
  data() {
    return {
      // url: "http://localhost:8090/iserver/services/map-shp-sxydshp/rest/maps/sxydshp",
      // dataurl: "http://localhost:8090/iserver/services/data-shp-sxydshp/rest/data",
      // tdtslurl: "http://localhost:8090/iserver/services/map-tianditu/rest/maps/矢量底图_经纬度",
      // tdtbqurl: "http://localhost:8090/iserver/services/map-tianditu/rest/maps/矢量中文注记_经纬度",
      // tdtyxurl: "http://localhost:8090/iserver/services/map-tianditu/rest/maps/影像底图_经纬度",
      // tdtyxzjurl: "http://localhost:8090/iserver/services/map-tianditu/rest/maps/影像中文注记_经纬度",
      // liankongurl: 'http://localhost:8090/iserver/services/map-shapefile-liankong/rest/maps/liankong',
      // liankongurl2: 'http://localhost:8090/iserver/services/map-shapefile-liankong/rest/maps/liankong',
      // xuqinurl:'http://localhost:8090/iserver/services/map-jinxianyang/rest/maps/jinxianyang',
      // yuanquurl: 'http://localhost:8090/iserver/services/data-gongnengfenqu/rest/data',
      // url: "http://10.16.11.240:15484/iserver/services/map-shp-sxydshp/rest/maps/sxydshp",
      // dataurl: "http://10.16.11.240:15484/iserver/services/data-shp-sxydshp/rest/data",
      // tdtslurl: "http://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/矢量底图_经纬度",
      // tdtbqurl: "http://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/矢量中文注记_经纬度",
      // tdtyxurl: "http://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/影像底图_经纬度",
      // tdtyxzjurl: "http://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/影像中文注记_经纬度",
      // liankongurl: 'http://10.16.11.240:15484/iserver/services/map-shp-liankong/rest/maps/liankong',
      //vpn新
      url: "https://10.226.77.11/iserver/services/map-shp-sxydshp/rest/maps/sxydshp",
      dataurl: "https://10.226.77.11/iserver/services/data-shp-sxydshp/rest/data",
      tdtslurl: "https://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/矢量底图_经纬度",
      tdtbqurl: "https://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/矢量中文注记_经纬度",
      tdtyxurl: "https://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/影像底图_经纬度",
      tdtyxzjurl: "https://10.226.77.11:8809/iserver/services/map-tianditu/rest/maps/影像中文注记_经纬度",
      liankongurl: 'https://10.226.77.11/iserver/services/map-shp-liankong/rest/maps/liankong',
      liankongurl2: 'https://10.226.77.11/iserver/services/map-daqiliankong/rest/maps/奎独乌联防联控区',
      liankongurl3: 'https://10.226.77.11/iserver/services/map-daqiliankong/rest/maps/乌昌石联防联控区',
      xuqinurl:'https://10.226.77.11/iserver/services/map-jinxianyang/rest/maps/jinxianyang',
      yuanquurl: 'https://10.226.77.11/iserver/services/data-gongnengfenqu/rest/data',
    
      //  url: "https://59.223.239.59:8807/iserver/services/map-shp-sxydshp/rest/maps/sxydshp",
      //  dataurl: "https://59.223.239.59:8807/iserver/services/data-shp-sxydshp/rest/data",
      //  tdtslurl: "https://59.223.239.59:443/super/services/map-tianditu/rest/maps/矢量底图_经纬度",
      //  tdtbqurl: "https://59.223.239.59:443/super/services/map-tianditu/rest/maps/矢量中文注记_经纬度",
      //  tdtyxurl: "https://59.223.239.59:443/super/services/map-tianditu/rest/maps/影像底图_经纬度",
      //  tdtyxzjurl: "https://59.223.239.59:443/super/services/map-tianditu/rest/maps/影像中文注记_经纬度",
      //  liankongurl: 'https://59.223.239.59:8807/iserver/services/map-shp-liankong/rest/maps/liankong',
      //  liankongurl2: 'https://59.223.239.59:8807/iserver/services/map-daqiliankong/rest/maps/奎独乌联防联控区',
      //  liankongurl3: 'https://59.223.239.59:8807/iserver/services/map-daqiliankong/rest/maps/乌昌石联防联控区',
      //  xuqinurl:'https://59.223.239.59:8807/iserver/services/map-jinxianyang/rest/maps/jinxianyang',
      //  yuanquurl: 'https://59.223.239.59:8807/iserver/services/data-gongnengfenqu/rest/data',
      //222
      // url: "https://10.222.77.11:8807/iserver/services/map-shp-sxydshp/rest/maps/sxydshp",
      //  dataurl: "https://10.222.77.11:8807/iserver/services/data-shp-sxydshp/rest/data",
      //  tdtslurl: "https://10.222.77.11:443/super/services/map-tianditu/rest/maps/矢量底图_经纬度",
      //  tdtbqurl: "https://10.222.77.11:443/super/services/map-tianditu/rest/maps/矢量中文注记_经纬度",
      //  tdtyxurl: "https://10.222.77.11:443/super/services/map-tianditu/rest/maps/影像底图_经纬度",
      //  tdtyxzjurl: "https://10.222.77.11:443/super/services/map-tianditu/rest/maps/影像中文注记_经纬度",
      //  liankongurl: 'https://10.222.77.11:8807/iserver/services/map-shp-liankong/rest/maps/liankong',
      //  liankongurl2: 'https://10.222.77.11:8807/iserver/services/map-daqiliankong/rest/maps/奎独乌联防联控区',
      //  liankongurl3: 'https://10.222.77.11:8807/iserver/services/map-daqiliankong/rest/maps/乌昌石联防联控区',
      //  xuqinurl:'https://10.222.77.11:8807/iserver/services/map-jinxianyang/rest/maps/jinxianyang',
      //  yuanquurl: 'https://10.222.77.11:8807/iserver/services/data-gongnengfenqu/rest/data',
      /*   url: "http://10.222.77.11:8807/iserver/services/map-shp-sxydshp/rest/maps/sxydshp",
        dataurl: "http://10.222.77.11:8807/iserver/services/data-shp-sxydshp/rest/data",
        tdtslurl: "http://10.10.11.240:15361/iserver/services/map-tianditu/rest/maps/矢量底图_经纬度",
        tdtbqurl: "http://10.10.11.240:15361/iserver/services/map-tianditu/rest/maps/矢量中文注记_经纬度",
        tdtyxurl: "http://10.10.11.240:15361/iserver/services/map-tianditu/rest/maps/影像底图_经纬度",
        tdtyxzjurl: "http://10.10.11.240:15361/iserver/services/map-tianditu/rest/maps/影像中文注记_经纬度",
        liankongurl: 'http://10.222.77.11:8807/iserver/services/map-shp-liankong/rest/maps/liankong',*/
      yingx: '影像',
      infoZk: 'true',
      tlshow: false,
      tlbtnshow: true,
      hxfenxi: [],
      hxShow: true,
      dxfenxi: [],
      dxShow: true,
      sxfenxi: [],
      sxShow: true,
      layerData: [],
      hzgeometry: '',
      hzgeometrytype: 'point',
      infoZkTo: false,
      activeNames: ['0'],
      picvalue: 'pic1',
      projectInfo: {
        name: '',
        huanPing: '',
        chanYe: '',
        zuoBiaoX: '',
        zuoBiaoY: ''
      },
      addFormRule: {
        name: [{
          required: true,
          message: '请输入项目名称',
          trigger: 'blur'
        }, {
          min: 2,
          max: 100,
          message: "项目名称的长度再2-100个字符之间",
          trigger: 'blur'
        }],
        thirdValue: [{
          required: true,
          message: '请选择环评类别',
          trigger: 'blur'
        }],
        /*  secondChanYeValue: [{
            required: true,
            message: '请选择产业类别',
            trigger: 'blur'
          }],*/
      },

      shiValue: '',
      quHua: [{
        value: 'd0',
        label: '全兵团'
      }, {
        value: 'd1',
        label: '第一师'
      }, {
        value: 'd2',
        label: '第二师'
      }, {
        value: 'd3',
        label: '第三师'
      }, {
        value: 'd4',
        label: '第四师'
      }, {
        value: 'd5',
        label: '第五师'
      }, {
        value: 'd6',
        label: '第六师'
      }, {
        value: 'd7',
        label: '第七师'
      }, {
        value: 'd8',
        label: '第八师'
      }, {
        value: 'd9',
        label: '第九师'
      }, {
        value: 'd10',
        label: '第十师'
      }, {
        value: 'd11',
        label: '第十一师'
      }, {
        value: 'd12',
        label: '第十二师'
      }, {
        value: 'd13',
        label: '第十三师'
      }, {
        value: 'd14',
        label: '第十四师'
      }],
      addPrijInfo: '新建项目信息',
      firstValue: '',
      firstLevel: [],
      secondDisabled: true,
      secondValue: '',
      secondLevel: [],
      thirdDisabled: true,
      thirdLevel: [],
      firstChanYeValue: '',
      firstChanYeLevel: [],
      secondChanYeDisabled: true,
      secondChanYeLevel: [],
      value: '',
      form: {
        name: '',
        thirdValue: '',
        secondChanYeValue: '',
      },
      formLabelWidth: '120px',
      addDialogFormVisible: false,
      shengTaiTuan: [],
      ShengTaiForm: {
        type: '',
        quHua: '',
        GongNengQuName: '',
        level: '',
        shuXing: '',
        faZhan: ''
      },
      guiZedialogVisible: false,
      guiZeLayer: [],
      guiZeForm: {
        name: [],
        guiZeData: [],
      },
      hxGuize: [],
      yaoSuLayerGuiZe: [],
      yaoSuData: [],
      DanYuanFrom: {
        bianMa: '',
        name: '',
        sheng: '',
        shi: '',
        xian: '',
        type: '',
        kongJianYueSu: '',
        wuRanWu: '',
        huanJingFengXian: '',
        ziYuanKaiFa: ''
      },
      danYuanData: [],
      huanPingFrom: {
        weiYiId: '',
        guiShu: '',
        fenLei: '',
        shenPi: '',
        tuanChangProj: '',
        tiaojian: '',
        isYuanqu: '',
        projectCategoryNum: '',
        categoryCondition: '',
        yuanQuResult: [],
        yuanQuName: [],
        yuanQuBm: [],
        yuanQuShiTuan: [],
        yuanQuChanYe: []
      },
      chanYeFrom: {
        zhiDao: '无',
        chanyeShow: true,
        xiBuDiQu: [],
        jinZhiSanGao: []
      },
      danYuanBm: [],
      popxy1: false,
      popxy: false,
      popxy2: false,
      popdata: {
        ysxl: '要素细类',
        fqbm: '分区编码',
        smc: '省名称',
        djmc: '地市名称',
        xmc: '县名称',
        hjys: '环境要素管控分区名称',
        length: '0',
        area: '0'
      },
      pop1data: {
        fqbm: '单元编码',
        smc: '省名称',
        djmc: '地市名称',
        xmc: '县名称',
        hjys: '环境管控单元名称',
        length: '0',
        area: '0',
        remakes: '备注'
      },
      popdata2: {
        ysxl: '要素细类',
        fqbm: '分区编码',
        smc: '省名称',
        djmc: '地市名称',
        xmc: '县名称',
        hjys: '环境要素管控分区名称',
        length: '0',
        area: '0',
        LYMC: '流域名称',
        HDMC: '河段名称',
        KZDMQDJD: '控制断面起点经度',
        KZDMQDWD: '',
        KZDMZDJD: '',
        KZDMZDWD: ''
      },
      baogao: {
        project_name: '',
        longitude: '',
        latitude: '',
        longitude0: '',
        latitude0: '',
        longitude1: '',
        latitude1: '',
        length: '',
        area: '',
        division: '',
        tuan: [],
        category_first: '',
        category_second: '',
        category_third: '',
        meaning: '',
        industry_first: '',
        industry_second: '',
        shenpitype: '',
        chanye: '',
        xibuchanye: '',
        sangaochanye: '',
        hongxian: '',
        hongxiantype: '',
        sydname: [],
        sydtype: '',
        shidiname: [],
        shiditype: '',
        sczname: [],
        scztype: '',
        dxsname: [],
        dxscity: [],
        shuiqitaname: [],
        shuiqitacity: [],
        liankong: '',
        xuqin:'',
        yuanqu: '',
        danyuan: '',
        yaosu: '',
        shengtaiData: [],
        shuiData: [],
        daqiData: [],
        ziranData: []
      },
      tabledata: [],
      tabledata2: [],
      yuanQuBm: [],
      formTeDing: {
        hxValue: '',
        shuiValue: '',
        shiDiValue: '',
        shuizhongValue: '',
      },
      hxData: [{
        id: 1,
        name: '（一）原住居民基本生产生活活动。包括：修缮生产生活设施，保留生活必需的种植、放牧、捕捞、养殖，服务于原住居民基本生产生活需要的电力、供水、供气、供暖、通信、道路、码头等基础设施、公共服务配套设施以及殡葬等特殊设施的建设、维护和改造等。'
      },
      {
        id: 2,
        name: '（二）自然资源、生态环境调查监测和执法，包括水文水资源监测和涉水违法事件查处，灾害防治和应急抢险，地质灾害调查评价、监测预警、工程治理等防治工作和应急抢险活动。'
      },
      {
        id: 3,
        name: '（三）经依法批准的古生物化石调查发掘和保护活动、非破坏性科学研究观测及必需的设施建设、标本采集。'
      },
      {
        id: 4,
        name: '（四）经依法批准的考古调查发掘和文物保护活动。'
      },
      {
        id: 5,
        name: '（五）不破坏生态功能的适度参观旅游和相关必要的公共设施建设。包括：污水处理、垃圾储运、公共卫生，供电、供气、供水、通讯，标识标志牌、道路、生态停车场、休憩休息设施，安全防护、应急避难、医疗救护、电子监控以及依法依规批准的配套性旅游设施等。'
      },
      {
        id: 6,
        name: '（六）必须且无法避让，符合县级以上国土空间规划的线性基础设施建设、防洪和供水设施建设与运行维护；已有合法水利、交通运输设施运行和维护等。包括：公路、铁路、海堤、桥梁、隧道，电缆，油气、供水、供热管线，航道基础设施；输变电、通讯基站等点状附属设施，河道、湖泊、海湾整治、海堤加固等。'
      },
      {
        id: 7,
        name: '（七）地质调查与矿产资源勘查开采。包括：基础地质调查和战略性矿产远景调查等公益性工作；巳依法设立的铀矿矿业权以及新立矿业权的勘查开采；巳依法设立的油气矿业权勘查，巳依法设立的油气采矿权不扩大用地用海范围的开采；巳依法设立的地热、矿泉水采矿权不超出核定生产规模、不新增生产设施条件下的开采；巳依法设立的和新立的铬、铜、镍、锂、钴、锆、钾盐、（中）重稀土矿探矿权开展勘查活动，因国家重大战略需要的，可办理采矿权登记。'
      },
      {
        id: 8,
        name: '（八）依据县级以上国土空间规划，经批准开展的重要生态修复工程。'
      }, {
        id: 9,
        name: '（九）确实难以避让的军事设施建设及重大军事演训活动。'
      }, {
        id: 10,
        name: '都不属于以上类别'
      }
      ],
      shuiYDData: [{
        id: 1,
        name: '属于供水设施、保护水源工程'
      }, {
        id: 2,
        name: '不属于供水设施、保护水源工程'
      }],
      ishxandshui: false,
      guojia: [],
      shengtaiBm: [],
      shengtaiTable: [],
      shuiBm: [],
      shuiTable: [],
      daqiBm: [],
      daqiTable: [],
      turanBm: [],
      turanTable: [],
      ziranziyuanBm: [],
      ziranziyuanTable: [],
      jdd: '',
      wdd: '',
      dialogVisibletype: false,
      jdu: null,
      jfen: null,
      jmiao: null,
      wdu: null,
      wfen: null,
      wmiao: null,
      manyindex: 1,
      inputData: [],
      nenghaoDialogFormVisibleAdd: false,
      nenghaoDialogFormVisibleAddcp: false,
      addWzForm: {
        parentId: "",
        conversionCoefficient: '',
        conversionCoefficientUnit: '',
        lowCalorific: '',
        lowCalorificUnit: '',
        substance: "",
        substanceUnit: '',
        standardCoal: 29271
      },
      addCpForm: {
        productName: '',
        indexName: '',
        indexUnit: '',
        admittanceValue: '',
        estimateAmount: '',
        levelStandard: 50000,
        standardUnit: '吨标煤',
        serialNum: ''
      },
      wuzhiunitData: [{
        value: '千克',
        label: '千克'
      }, {
        value: '立方米',
        label: '立方米'
      }],
      zhebianxishuData: [{
        value: '千克标煤/千克',
        label: '千克标煤/千克'
      }, {
        value: '千克标煤/立方米',
        label: '千克标煤/立方米'
      }],
      diweifareliangunitData: [{
        value: '千焦/千克',
        label: '千焦/千克'
      }, {
        value: '千焦/立方米',
        label: '千焦/立方米'
      }],
      zhibiaounitData: [{
        value: '克/千瓦时',
        label: '克/千瓦时'
      }, {
        value: '千克/吉焦',
        label: '千克/吉焦'
      }, {
        value: '千克/吨',
        label: '千克/吨'
      }, {
        value: '千克/立方米',
        label: '千克/立方米'
      }],
      zhebiaoData: [{
        value: '1000',
        label: '1000'
      }, {
        value: '1000000',
        label: '1000000'
      }],
      addFormRuleWz: {
        parentId: [{
          required: true,
          message: '请选择种类',
          trigger: 'blur'
        }],
        substance: [{
          required: true,
          message: '请输入物质名称',
          trigger: 'blur'
        }],
        conversionCoefficient: [{
          required: true,
          message: '请输入折标系数',
          trigger: 'blur'
        }],
        conversionCoefficientUnit: [{
          required: true,
          message: '请选择折标系数单位',
          trigger: 'blur'
        }],
        substanceUnit: [{
          required: true,
          message: '请选择物质单位',
          trigger: 'blur'
        }],
        standardCoal: [{
          required: true,
          message: '请输入标煤低位发热量',
          trigger: 'blur'
        }],
        lowCalorificUnit: [{
          required: true,
          message: '请选择低位发热量单位',
          trigger: 'blur'
        }],
        lowCalorific: [{
          required: true,
          message: '请输入平均低位发热量',
          trigger: 'blur'
        }],
      },
      addFormRuleCp: {
        productName: [{
          required: true,
          message: '请输入产品名称',
          trigger: 'blur'
        }],
        indexName: [{
          required: true,
          message: '请输入指标名称',
          trigger: 'blur'
        }],
        indexUnit: [{
          required: true,
          message: '请选择指标单位',
          trigger: 'blur'
        }],
        estimateAmount: [{
          required: true,
          message: '请选择折标系数',
          trigger: 'blur'
        }],
        admittanceValue: [{
          required: true,
          message: '请输入准入值',
          trigger: 'blur'
        }],
      },
      nenghaoDialogFormVisible: false,
      nenghaoData: [
        {
          chanpingName: '',
          chanpingNum: '',
          chanpingValue: 0,
          estimateAmount: 1,
          wuziData: [],
          haonengwuziData: [{
            name: '',
            type: '1',
            num: '',
          }],
          nengyuanwuziData: [{
            name: '',
            type: '2',
            num: '',
          }],
          redianwuziData: [{
            name: '',
            type: '3',
            num: '',
          }],
          xiaohaoData: [],
          xiaohaoDatanengyuan: [{
            name: '',
            type: '2',
            num: '',
          }],
          xiaohaoDataredian: [{
            name: '',
            type: '3',
            num: '',
          }],
        }
      ],
      nenghaoFormRule: {
        /*chanpingName: [{
          required: true,
          message: '请选择产品名称',
          trigger: 'blur'
        }],
        chanpingNum: [{
          required: true,
          message: '请输入产品数量',
          trigger: 'blur'
        }],*/
      },
      chanpingData: [],
      zhongleiData: [],
      zlwuziData1: [],
      zlwuziData2: [],
      zlwuziData3: [],
      zlwuziDataJian: [],
      /*wuziFrom:{
        id:'',
        substance:'',
        substanceUnit:'',
        lowCalorific:'',
        lowCalorificUnit:"",
        conversionCoefficient:'',
        conversionCoefficientUnit:'',
      },*/
      fenxiresult: [],
      dangliangALL: 0,
      dengjiaALL: 0,
      nengyuandangliangALL: 0,
      nengyuandengjiaALL: 0,
      dangliangjianALL: 0,
      dengjiajianALL: 0,
      zhonghenenghaodangliang: 0,
      zhonghenenghaodengjia: 0,
      zhonghenengyuandangliang: 0,
      zhonghenengyuandengjia: 0,
      nengyuanhejidangliang: 0,
      nengyuanhejidengjia: 0,
      menleiData: [],
      daleiData: [],
      zhongData: [],
      xiaoleiData: [],
      xiaoleiValue: '',
      zhongleiValue: '',
      daleiValue: '',
      menleiValue: '',
      daleiDisabled: true,
      zhongleiDisabled: true,
      xiaoleiDisabled: true,
      isxuqin:false,
    }
  },
  async created() {
    /*const {data:result3}= await this.$http.post('/v1.0/resultIntegration/rule/externalSystem',{
      "appId": "string",
      "data": JSON.stringify(data),
      "service": "getAppEeCompanyProjectDetail",
      "sign": "string",
      "time": 0,
      "version": "string"
    })*/
    const { data: result } = await this.$http2.get('/services/map-shp-sxydshp/rest/maps/sxydshp/layers/sxydshp.rjson')
    for (let x in result.subLayers.layers) {
      if (x % 2 != 0) {
        this.layerData.push({ name: result.subLayers.layers[x].name })
      }
    }
    this.getAllproduct();
    this.wzzhongleiChange();
    this.getALLmenlei();
    const { data: result1 } = await this.$http.get('/v1.0/resultIntegration/rule/eiaCategory/findAllEIACategory')
    this.firstLevel = result1.data;
    const { data: result2 } = await this.$http.get('/v1.0/resultIntegration/rule/industrialStructureCategory/findAllIndustrialStructureCategory')
    this.firstChanYeLevel = result2.data;
    var data = { "limit": "100" };
    // const { data: result0 } = await this.$http.post('/v1.0/resultIntegration/rule/externalSystem', {
    //   "appId": "string",
    //   "data": JSON.stringify(data),
    //   "service": "getAppEeCompanyProjectList",
    //   "sign": "string",
    //   "time": 0,
    //   "version": "string"
    // })
    // var da = JSON.parse(result0.data).data;
    // for (let i in da) {
    //   if (da[i].examineStatus == 'APP_8') {
    //     const { data: result3 } = await this.$http.post('/v1.0/resultIntegration/rule/externalSystem', {
    //       "appId": "string",
    //       "data": JSON.stringify({ "projectId": da[i].id }),
    //       "service": "getAppEeCompanyProjectDetail",
    //       "sign": "string",
    //       "time": 0,
    //       "version": "string"
    //     })
    //     if (JSON.parse(result3.data).locations) {
    //       this.guojia.push({ zuobiao: JSON.parse(result3.data).locations, name: JSON.parse(result3.data).data })
    //     }
    //   }
    // }
  },
  computed: {
    zhunruzhi: function () {
      var zhunru = 0
      for (let i in this.nenghaoData) {
        zhunru += (this.nenghaoData[i].chanpingValue * this.nenghaoData[i].chanpingNum) / this.nenghaoData[i].estimateAmount
      }
      return zhunru
    }
  },
  mounted() {
    this.addmap()
    eventBus.$on('hztype', (type) => {
      this.hzgeometrytype = type;
      if (type == 'point') {
        this.hzPoint();
      } else if (type == 'line') {
        this.hzLine();
      } else if (type == 'reo') {
        this.hzReo();
      }
    });
    eventBus.$on('hztype2', (point) => {
      this.hzgeometrytype = 'point';
      this.projectInfo.zuoBiaoX = parseFloat(point[0]);
      this.projectInfo.zuoBiaoY = parseFloat(point[1]);
      this.hzPoint2(parseFloat(point[0]), parseFloat(point[1]));
    });
    eventBus.$on('hztype1', (geo) => {
      this.showShp(geo);
    });
    eventBus.$on('huanchong', (options) => {
      this.buffer(options[0], options[1])
    });
    eventBus.$on('chongtu', (ct) => {
      if (ct == "chongtu") {
        this.kjct();
      } else if (ct == 'tuijian') {
        this.tuiJian();
      }
    });
    eventBus.$on('nenghao', (ct) => {
      if (ct == "nenghao") {
        this.nenghaoDialogFormVisible = true;
      } else if (ct == 'add') {
        this.nenghaoDialogFormVisibleAdd = true;
      } else if (ct == 'addcp') {
        this.nenghaoDialogFormVisibleAddcp = true;
      }
    });

    eventBus.$on('addProj', (ct) => {
      if (ct == "addProj") {
        this.addDialogFormVisible = true;
      }
    });
    eventBus.$on('manyPoint', (type) => {
      this.hzgeometrytype = type;
      this.inputData = []
      this.clearInteraction();
      source.clear();
      if (type == 'line') {
        this.dialogVisibletype = true;
      } else if (type == 'reo') {
        this.dialogVisibletype = true;
      }
    });

    document.getElementsByClassName('ol-zoom-in')[0].title = '放大';
    document.getElementsByClassName('ol-zoom-out')[0].title = '缩小';
    document.getElementsByClassName('ol-full-screen-false')[0].title = '全屏';
  },
  methods: {
    async getALLmenlei() {
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/twoHigh/findAll')
      if (result.status == '3000') {
        this.menleiData = result.data
      } else {
        this.menleiData = []
      }
    },
    async menleiChange(item) {
      console.log(item)
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/twoHigh/findByFirstParentId/' + item.value)
      if (result.status == '3000') {
        this.daleiData = result.data
        this.daleiDisabled = false
      } else {
        this.daleiData = []
      }
    },
    async daleiChange(item) {
      console.log(item)
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/twoHigh/findBySecondParentId/' + item.value)
      if (result.status == '3000') {
        this.zhongData = result.data
        this.zhongleiDisabled = false
      } else {
        this.zhongData = []
      }
    },
    async zhongleiChange(item) {
      console.log(item)
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/twoHigh/findByThirdParentId/' + item.value)
      if (result.status == '3000') {
        this.xiaoleiData = result.data
        this.xiaoleiDisabled = false
      } else {
        this.xiaoleiData = []
      }
    },
    async getAllproduct() {
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/admittanceValue/findAll')
      if (result.status == '3000') {
        this.chanpingData = result.data
      } else {
        this.chanpingData = []
      }
      const { data: result2 } = await this.$http.get('/v1.0/resultIntegration/rule/substanceParam/findAll')
      if (result2.status == '3000') {
        this.zhongleiData = result2.data
        /*this.zlwuziDataJian= result2.data.concat();
        this.zlwuziDataJian.shift()*/
        //console.log(this.zlwuziDataJian)
      } else {
        this.zhongleiData = []
      }
    },
    async chanpingChange(obj, item) {
      item.chanpingValue = Number(obj.itemcp.admittanceValue)
      item.estimateAmount = Number(obj.itemcp.estimateAmount)
    },
    async wzzhongleiChange() {
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/substanceParam/findAllByParentId/1')
      if (result.status == '3000') {
        this.zlwuziData1 = result.data
      } else {
        this.zlwuziData1 = []
      }
      const { data: result2 } = await this.$http.get('/v1.0/resultIntegration/rule/substanceParam/findAllByParentId/2')
      if (result2.status == '3000') {
        this.zlwuziData2 = result2.data
      } else {
        this.zlwuziData2 = []
      } const { data: result3 } = await this.$http.get('/v1.0/resultIntegration/rule/substanceParam/findAllByParentId/3')
      if (result3.status == '3000') {
        this.zlwuziData3 = result3.data
      } else {
        this.zlwuziData3 = []
      }
    },
    wuziChange(obj, item2) {
      item2['conversionCoefficient'] = obj.item.conversionCoefficient
      item2['conversionCoefficientUnit'] = obj.item.conversionCoefficientUnit
      item2['lowCalorific'] = obj.item.lowCalorific
      item2['lowCalorificUnit'] = obj.item.lowCalorificUnit
      item2['substance'] = obj.item.substance
    },
    async addmap() {
      map = new Map({
        target: 'map',
        controls: control.defaults({
          attribution: false
        }),
        view: new View({
          center: [85.28838135, 42.209817352],
          zoom: 6,
          maxZoom: 21,
          projection: 'EPSG:4326'
        }),
      });
      var fullScreenControl = new control.FullScreen();
      map.addControl(fullScreenControl);
      tdtslLayer = new TileLayer({
        source: new TileSuperMapRest({
          crossOrigin: 'anonymous',
          url: this.tdtslurl,
          wrapX: false
        }),
        projection: 'EPSG:4326'
      });
      // tdtslLayer =new TileLayer({
      //   opacity: 1,
      //   source: new WMTS({
      //     url: "http://t0.tianditu.gov.cn/vec_c/wmts?tk=" + webKey,
      //     layer: 'vec',
      //     matrixSet: 'c',
      //     format: 'tiles',
      //     style: 'default',
      //     projection: projection,
      //     crossOrigin: 'anonymous',
      //     tileGrid: new WMTSTileGrid({
      //       origin: olExtent.getTopLeft(projectionExtent),
      //       resolutions: resolutions,
      //       matrixIds: matrixIds
      //     }),
      //     wrapX: false
      //   })
      // });
      tdtbqLayer = new TileLayer({
        source: new TileSuperMapRest({
          crossOrigin: 'anonymous',
          url: this.tdtbqurl,
          wrapX: false
        }),
        projection: 'EPSG:4326'
      });
      // tdtbqLayer =new TileLayer({
      //   opacity: 1,
      //   source: new WMTS({
      //     url: "http://t0.tianditu.gov.cn/cva_c/wmts?tk=" + webKey,
      //     layer: 'cva',
      //     matrixSet: 'c',
      //     format: 'tiles',
      //     style: 'default',
      //     projection: projection,
      //     crossOrigin: 'anonymous',
      //     tileGrid: new WMTSTileGrid({
      //       origin: olExtent.getTopLeft(projectionExtent),
      //       extent: [-180.0, -90.0, 180.0, 90.0],
      //       resolutions: resolutions,
      //       matrixIds: matrixIds
      //     }),
      //     wrapX: false
      //   })
      // });
      tdtyxLayer = new TileLayer({
        source: new TileSuperMapRest({
          crossOrigin: 'anonymous',
          url: this.tdtyxurl,
          wrapX: false
        }),
        projection: 'EPSG:4326'
      });

      //  tdtyxLayer = new TileLayer({
      //   opacity: 1,
      //   source: new WMTS({
      //     url: "http://t0.tianditu.gov.cn/img_c/wmts?tk=" + webKey,
      //     layer: 'img',
      //     matrixSet: 'c',
      //     format: 'tiles',
      //     style: 'default',
      //     crossOrigin: 'anonymous',
      //     projection: projection,
      //     tileGrid: new WMTSTileGrid({
      //       origin: olExtent.getTopLeft(projectionExtent),
      //       resolutions: resolutions,
      //       matrixIds: matrixIds
      //     }),
      //     wrapX: false
      //   })
      // });
      tdtyxzjLayer = new TileLayer({
        source: new TileSuperMapRest({
          url: this.tdtyxzjurl,
          wrapX: false
        }),
        projection: 'EPSG:4326'
      });
      // tdtyxzjLayer= new TileLayer({
      //   opacity: 1,
      //   source: new WMTS({
      //     url: "http://t0.tianditu.gov.cn/cia_c/wmts?tk=" + webKey,
      //     layer: 'cia',
      //     matrixSet: 'c',
      //     format: 'tiles',
      //     style: 'default',
      //     projection: projection,
      //     crossOrigin: 'anonymous',
      //     tileGrid: new WMTSTileGrid({
      //       origin: olExtent.getTopLeft(projectionExtent),
      //       resolutions: resolutions,
      //       matrixIds: matrixIds
      //     }),
      //     wrapX: false
      //   })
      // });
      var shplayer = new TileLayer({
        source: new TileSuperMapRest({
          url: this.url,
          wrapX: false
        }),
        projection: 'EPSG:4326'
      });
      tdtyxLayer.setVisible(false);
      tdtyxzjLayer.setVisible(false);
      var lianklayer = new TileLayer({
        source: new TileSuperMapRest({
          crossOrigin: 'anonymous',
          url: this.liankongurl2,
          wrapX: false
        }),
        projection: 'EPSG:4326'
      });
      var lianklayer2 = new TileLayer({
        source: new TileSuperMapRest({
          crossOrigin: 'anonymous',
          url: this.liankongurl3,
          wrapX: false
        }),
        projection: 'EPSG:4326'
      });
      map.addLayer(tdtslLayer);
      map.addLayer(tdtyxLayer);
      map.addLayer(tdtbqLayer);
      map.addLayer(tdtyxzjLayer);
      map.addLayer(lianklayer);
      map.addLayer(lianklayer2);
      var xjSource = new VectorSource({
        //  url: 'http://localhost:8081/xj.json',
        url: './xj.json',
        //   url: 'http://10.16.11.240:15487/xj.json',

        format: new GeoJSON(),
        wrapX: false
      });
      var xjLayer = new VectorLayer({
        source: xjSource,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(128, 0 ,128)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(128, 0 ,128, 0.01)'
          })
        })
      });
      map.addLayer(xjLayer)
      var shiSource = new VectorSource({
        wrapX: false
      });
      var shiLayer = new VectorLayer({
        source: shiSource,
      });
      //  const {data:result}= await this.$http.get('http://10.16.11.240:15487/shi.json')
      const { data: result } = await this.$http1.get('./shi.json')
      for (let i = 0; i < result.length; i++) {
        var shifea1 = new Feature({
          geometry: new Point([result[i].经度, result[i].纬度]),
          name: result[i].标准名
        });
        shifea1.setStyle(createShiStyle(shifea1));
        shiSource.addFeature(shifea1);
      }
      var tuanSource = new VectorSource({
        wrapX: false
      });
      var tuanLayer = new VectorLayer({
        source: tuanSource,
      });
      //   const {data:result2}= await this.$http.get('http://10.16.11.240:15487/tuan.json')
      const { data: result2 } = await this.$http1.get('./tuan.json')
      for (let i = 0; i < result2.length; i++) {
        var tuanfea1 = new Feature({
          geometry: new Point([result2[i].经度, result2[i].纬度]),
          name: result2[i].标准名
        });
        tuanfea1.setStyle(createTuanStyle(tuanfea1));
        tuanSource.addFeature(tuanfea1);
      }
      tuanLayer.setVisible(false)

      map.getView().on('change:resolution', function () {
        if (map.getView().getZoom() < 9) {
          tuanLayer.setVisible(false);
        }
        if (map.getView().getZoom() >= 9) {
          tuanLayer.setVisible(true);
        }
      });
      map.on('pointermove', (evt) => {
        this.jdd = this.jwdzshjz(evt.coordinate[0].toFixed(8))
        this.wdd = this.jwdzshjz(evt.coordinate[1].toFixed(8))
      })
      hxSource = new VectorSource({
        wrapX: false
      });
      dxSource = new VectorSource({
        wrapX: false
      });
      dxSource2 = new VectorSource({
        wrapX: false
      });
      sxSource = new VectorSource({
        wrapX: false
      });
      yxSource = new VectorSource({
        wrapX: false
      });
      zdSource = new VectorSource({
        wrapX: false
      });
      ybSource = new VectorSource({
        wrapX: false
      });

      hxLayer = new VectorLayer({
        source: hxSource,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(255, 0 ,0)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(255, 0 ,0, 0.3)'
          })
        })
      });
      dxLayer = new VectorLayer({
        source: dxSource,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(28, 220 ,48)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(28, 220 ,128, 0.3)'
          })
        })
      });
      dxLayer2 = new VectorLayer({
        source: dxSource2,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(128, 120 ,28)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(128, 120 ,28, 0.3)'
          })
        })
      });
      sxLayer = new VectorLayer({
        source: sxSource,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(228, 110 ,28)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(228, 110 ,28, 0.3)'
          })
        })
      });
      yxLayer = new VectorLayer({
        source: yxSource,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(44, 32 ,168)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(44, 32 ,168, 0.3)'
          })
        })
      });
      zdLayer = new VectorLayer({
        source: zdSource,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(228, 110 ,218)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(228, 110 ,218, 0.3)'
          })
        })
      });
      ybLayer = new VectorLayer({
        source: ybSource,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: 'rgb(168, 102 ,115)',
            width: 3
          }),
          fill: new Fill({
            color: 'rgba(168, 102 ,115, 0.3)'
          })
        })
      });
      selectSouce = new VectorSource({
        wrapX: false
      });
      selectLayer = new VectorLayer({
        source: selectSouce,
        style: new Style({
          stroke: new Stroke({
            //color: '#0033ff',
            color: '#66B1FF',
            width: 3
          }),
        })
      });

      map.addLayer(hxLayer);
      map.addLayer(dxLayer);
      map.addLayer(dxLayer2);
      map.addLayer(sxLayer);
      map.addLayer(yxLayer);
      map.addLayer(zdLayer);
      map.addLayer(ybLayer);
      map.addLayer(vector);
      map.addLayer(vector1);
      map.addLayer(shiLayer)
      map.addLayer(tuanLayer);
      map.addLayer(gjLayer);
      map.addLayer(pLayer);
      map.addLayer(selectLayer);
      stbqSource = new VectorSource({
        wrapX: false
      });
      stbqLayer = new VectorLayer({
        source: stbqSource,
      });
      shuibqSource = new VectorSource({
        wrapX: false
      });
      shuibqLayer = new VectorLayer({
        source: shuibqSource,
      });
      daqibqSource = new VectorSource({
        wrapX: false
      });
      daqibqLayer = new VectorLayer({
        source: daqibqSource,
      });
      ziranbqSource = new VectorSource({
        wrapX: false
      });
      ziranbqLayer = new VectorLayer({
        source: ziranbqSource,
      });
      yxdybqSource = new VectorSource({
        wrapX: false
      });
      yxdybqLayer = new VectorLayer({
        source: yxdybqSource,
      });
      zddybqSource = new VectorSource({
        wrapX: false
      });
      zddybqLayer = new VectorLayer({
        source: zddybqSource,
      });
      ybdybqSource = new VectorSource({
        wrapX: false
      });
      ybdybqLayer = new VectorLayer({
        source: ybdybqSource,
      });
      stbqLayer.setVisible(false)
      shuibqLayer.setVisible(false)
      daqibqLayer.setVisible(false)
      ziranbqLayer.setVisible(false)
      yxdybqLayer.setVisible(false)
      zddybqLayer.setVisible(false)
      ybdybqLayer.setVisible(false)
      map.addLayer(stbqLayer);
      map.addLayer(shuibqLayer);
      map.addLayer(daqibqLayer);
      map.addLayer(ziranbqLayer);
      map.addLayer(yxdybqLayer);
      map.addLayer(zddybqLayer);
      map.addLayer(ybdybqLayer);
      //map.addLayer(yuanLayer);
      popO = new Overlay({
        element: document.getElementById('popup1'),
        autoPan: true,
        autoPanAnimation: {
          duration: 250
        },
        offset: [0, -20]
      });
      pop1 = new Overlay({
        element: document.getElementById('popup2'),
        autoPan: true,
        autoPanAnimation: {
          duration: 250
        },
        offset: [0, -20]
      });
      pop2 = new Overlay({
        element: document.getElementById('popup3'),
        autoPan: true,
        autoPanAnimation: {
          duration: 250
        },
        offset: [0, -20]
      });
      map.on('click', evt => {
        var zt = 0;
        var coordinate = evt.coordinate;
        //var dpoint=new geoPoint(evt.coordinate);
        map.forEachFeatureAtPixel(evt.pixel, (cxfeature, layerVetor) => {
          zt++;
          if (zt != 1) {
            return;
          }
          selectSouce.clear();
          console.log(cxfeature)
          selectSouce.addFeature(cxfeature)
          if (layerVetor == hxLayer) {
            this.popdata.ysxl = cxfeature.values_.YSXL;
            this.popdata.fqbm = cxfeature.values_.HJYSGKFQBM;
            this.popdata.smc = cxfeature.values_.PROV;
            this.popdata.djmc = cxfeature.values_.CITY;
            this.popdata.xmc = cxfeature.values_.COUNTY;
            this.popdata.hjys = cxfeature.values_.HJYSGKFQMC;
            this.popdata.length = cxfeature.values_.SHAPE_Leng + '十万米';
            this.popdata.area = (cxfeature.values_.Shape_Area * 10000).toFixed(2) + '平方公里';
            this.popxy = true;
            this.popxy1 = false;
            this.popxy2 = false;
            map.addOverlay(popO);
            popO.setPosition(coordinate);
            map.getView().setCenter(coordinate);
            // this.fenxi(cxfeature.getGeometry())
          } else if (layerVetor == dxLayer || layerVetor == dxLayer2) {
            if (cxfeature.values_.HJYS == '2') {
              this.popdata2.ysxl = cxfeature.values_.YSXL;
              this.popdata2.fqbm = cxfeature.values_.HJYSGKFQBM;
              this.popdata2.smc = cxfeature.values_.PROV;
              this.popdata2.djmc = cxfeature.values_.CITY;
              this.popdata2.xmc = cxfeature.values_.COUNTY;
              this.popdata2.hjys = cxfeature.values_.HJYSGKFQMC;
              this.popdata2.length = cxfeature.values_.SHAPE_Leng + '十万米';
              this.popdata2.area = (cxfeature.values_.Shape_Area * 10000).toFixed(2) + '平方公里';
              this.popdata2.LYMC = cxfeature.values_.LYMC;
              this.popdata2.HDMC = cxfeature.values_.HDMC;
              this.popdata2.KZDMQDJD = cxfeature.values_.KZDMQDJD;
              this.popdata2.KZDMQDWD = cxfeature.values_.KZDMQDWD;
              this.popdata2.KZDMZDJD = cxfeature.values_.KZDMZDJD;
              this.popdata2.KZDMZDWD = cxfeature.values_.KZDMZDWD;
              this.popxy = false;
              this.popxy1 = false;
              this.popxy2 = true;
              map.addOverlay(pop2);
              pop2.setPosition(coordinate);
            } else {
              this.popdata.ysxl = cxfeature.values_.YSXL;
              this.popdata.fqbm = cxfeature.values_.HJYSGKFQBM;
              this.popdata.smc = cxfeature.values_.PROV;
              this.popdata.djmc = cxfeature.values_.CITY;
              this.popdata.xmc = cxfeature.values_.COUNTY;
              this.popdata.hjys = cxfeature.values_.HJYSGKFQMC;
              this.popdata.length = cxfeature.values_.SHAPE_Leng + '十万米';
              this.popdata.area = (cxfeature.values_.Shape_Area * 10000).toFixed(2) + '平方公里';
              this.popxy = true;
              this.popxy1 = false;
              this.popxy2 = false;
              map.addOverlay(popO);
              popO.setPosition(coordinate);
            }
            map.getView().setCenter(coordinate);
            //this.fenxi(cxfeature.getGeometry())
          } else if (layerVetor == sxLayer) {
            this.popdata.ysxl = cxfeature.values_.YSXL;
            this.popdata.fqbm = cxfeature.values_.HJYSGKFQBM;
            this.popdata.smc = cxfeature.values_.PROV;
            this.popdata.djmc = cxfeature.values_.CITY;
            this.popdata.xmc = cxfeature.values_.COUNTY;
            this.popdata.hjys = cxfeature.values_.HJYSGKFQMC;
            this.popdata.length = cxfeature.values_.SHAPE_Leng + '十万米';
            this.popdata.area = (cxfeature.values_.Shape_Area * 10000).toFixed(2) + '平方公里';
            this.popxy = true;
            this.popxy1 = false;
            this.popxy2 = false;
            map.addOverlay(popO);
            popO.setPosition(coordinate);
            map.getView().setCenter(coordinate);
            // this.fenxi(cxfeature.getGeometry())
          } else if (layerVetor == yxLayer) {
            this.pop1data.fqbm = cxfeature.values_.HJGKDYBM;
            this.pop1data.smc = cxfeature.values_.PROV;
            this.pop1data.djmc = cxfeature.values_.CITY;
            this.pop1data.xmc = cxfeature.values_.COUNTY;
            this.pop1data.hjys = cxfeature.values_.HJGKDYMC;
            this.pop1data.length = cxfeature.values_.SHAPE_Leng;
            this.pop1data.area = (cxfeature.values_.Shape_Area * 10000).toFixed(2) + '平方公里';
            this.pop1data.remakes = cxfeature.values_.REMARKS;
            this.popxy = false;
            this.popxy1 = true;
            this.popxy2 = false;
            map.addOverlay(pop1);
            pop1.setPosition(coordinate);
            map.getView().setCenter(coordinate);
            //this.fenxi(cxfeature.getGeometry())
          } else if (layerVetor == zdLayer) {
            this.pop1data.fqbm = cxfeature.values_.HJGKDYBM;
            this.pop1data.smc = cxfeature.values_.PROV;
            this.pop1data.djmc = cxfeature.values_.CITY;
            this.pop1data.xmc = cxfeature.values_.COUNTY;
            this.pop1data.hjys = cxfeature.values_.HJGKDYMC;
            this.pop1data.length = cxfeature.values_.SHAPE_Leng;
            this.pop1data.area = (cxfeature.values_.Shape_Area * 10000).toFixed(2) + '平方公里';
            this.pop1data.remakes = cxfeature.values_.REMARKS;
            this.popxy = false;
            this.popxy1 = true;
            this.popxy2 = false;
            map.addOverlay(pop1);
            pop1.setPosition(coordinate);
            map.getView().setCenter(coordinate);
            //this.fenxi(cxfeature.getGeometry())
          } else if (layerVetor == ybLayer) {
            this.pop1data.fqbm = cxfeature.values_.HJGKDYBM;
            this.pop1data.smc = cxfeature.values_.PROV;
            this.pop1data.djmc = cxfeature.values_.CITY;
            this.pop1data.xmc = cxfeature.values_.COUNTY;
            this.pop1data.hjys = cxfeature.values_.HJGKDYMC;
            this.pop1data.length = cxfeature.values_.SHAPE_Leng;
            this.pop1data.area = (cxfeature.values_.Shape_Area * 10000).toFixed(2) + '平方公里';
            this.pop1data.remakes = cxfeature.values_.REMARKS;
            this.popxy = false;
            this.popxy1 = true;
            this.popxy2 = false;
            map.addOverlay(pop1);
            pop1.setPosition(coordinate);
            map.getView().setCenter(coordinate);
            //this.fenxi(cxfeature.getGeometry())
          }
        })
      })
      bufferSource = new VectorSource({
        wrapX: false
      });
      bufferLayer = new VectorLayer({
        source: bufferSource
      });
      map.addLayer(bufferLayer);
    },
    hzPoint() {
      this.clearInteraction();
      draw = new Draw({
        source: pSource,
        type: 'Point',
        snapTolerance: 20
      });
      map.addInteraction(draw);
      draw.on('drawstart', function (evt) {  // set sketch
        pSource.clear();
      });
      draw.on('drawend', (evt) => {  // unset sketch
        this.projectInfo.zuoBiaoX = evt.target.sketchCoords_[0].toFixed(6);
        this.projectInfo.zuoBiaoY = evt.target.sketchCoords_[1].toFixed(6);
        //报告
        /*this.baogao.longitude='东经 '+evt.target.sketchCoords_[0].toFixed(4);
        this.baogao.latitude='北纬 '+evt.target.sketchCoords_[1].toFixed(4);*/
        /* this.baogao.longitude='东经：'+evt.target.sketchCoords_[0].toFixed(4)+'('+this.jwdzshjz(evt.target.sketchCoords_[0].toFixed(4))+')';
         this.baogao.latitude='北纬：'+evt.target.sketchCoords_[1].toFixed(4)+'('+this.jwdzshjz(evt.target.sketchCoords_[1].toFixed(4))+')';*/
        this.baogao.longitude = '东经：' + this.jwdzshjz(evt.target.sketchCoords_[0].toFixed(6));
        this.baogao.latitude = '北纬：' + this.jwdzshjz(evt.target.sketchCoords_[1].toFixed(6));
        this.clearInteraction();
        this.hzgeometry = evt.feature.getGeometry();
      });
    },
    hzPoint2(x, y) {
      this.projectInfo.zuoBiaoX = x.toFixed(6);
      this.projectInfo.zuoBiaoY = y.toFixed(6);
      /* this.baogao.longitude='东经：'+x.toFixed(4)+'('+this.jwdzshjz(x.toFixed(4))+')';
       this.baogao.latitude='北纬：'+y.toFixed(4)+'('+this.jwdzshjz(y.toFixed(4))+')';*/
      this.baogao.longitude = '东经：' + this.jwdzshjz(x.toFixed(6));
      this.baogao.latitude = '北纬：' + this.jwdzshjz(y.toFixed(6));
      this.hzgeometry = new Point([x, y]);
      pSource.addFeature(new Feature(this.hzgeometry))
    },
    hzLine() {
      this.clearInteraction();
      draw = new Draw({
        source: source,
        type: 'LineString',
        snapTolerance: 20
      });
      map.addInteraction(draw);
      draw.on('drawstart', function (evt) {  // set sketch
        source.clear();
      });
      draw.on('drawend', (evt) => {  // unset sketch
        this.clearInteraction();
        this.hzgeometry = evt.feature.getGeometry();
        this.baogao.longitude0 = '东经：' + this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[0].toFixed(6));
        this.baogao.latitude0 = '北纬：' + this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[1].toFixed(6));
        this.baogao.longitude1 = '东经：' + this.jwdzshjz(this.hzgeometry.getLastCoordinate()[0].toFixed(6));
        this.baogao.latitude1 = '北纬：' + this.jwdzshjz(this.hzgeometry.getLastCoordinate()[1].toFixed(6));
        this.baogao.length = formatLength(this.hzgeometry);
      });
    },
    hzReo() {
      this.clearInteraction();
      draw = new Draw({
        source: source,
        type: 'Polygon',
        snapTolerance: 20
      });
      map.addInteraction(draw);
      draw.on('drawstart', function (evt) {  // set sketch
        source.clear();
      });
      draw.on('drawend', (evt) => {  // unset sketch
        this.clearInteraction();
        this.hzgeometry = evt.feature.getGeometry();
        this.hzgeometry = evt.feature.getGeometry();
        this.baogao.longitude0 = '东经：' + this.jwdzshjz(olExtent.getCenter(this.hzgeometry.getExtent())[0].toFixed(6));
        this.baogao.latitude0 = '北纬：' + this.jwdzshjz(olExtent.getCenter(this.hzgeometry.getExtent())[1].toFixed(6));
        /*     this.baogao.longitude0='东经：'+this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[0].toFixed(4));
             this.baogao.latitude0='北纬：'+this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[1].toFixed(4));
             this.baogao.longitude1='东经：'+this.jwdzshjz(this.hzgeometry.getLastCoordinate()[0].toFixed(4));
             this.baogao.latitude1='北纬：'+this.jwdzshjz(this.hzgeometry.getLastCoordinate()[1].toFixed(4));*/
        this.baogao.area = formatArea(this.hzgeometry);
      });
    },
    nextOne() {
      if (Number(this.jdu) <= -180 || Number(this.jdu) >= 180 || Number(this.wdu) <= -180 || Number(this.wdu) >= 180) {
        this.$message.error('您输入的经纬度不合法，请重新输入')
      } else {
        this.inputData.push([this.jwdzsjz(Number(this.jdu), Number(this.jfen), Number(this.jmiao)), this.jwdzsjz(Number(this.wdu), Number(this.wfen), Number(this.wmiao))])
        this.jdu = '', this.jfen = '', this.jmiao = '', this.wdu = '', this.wfen = '', this.wmiao = '';
        this.manyindex++;
      }

    },
    over() {
      if (Number(this.jdu) <= -180 || Number(this.jdu) >= 180 || Number(this.wdu) <= -180 || Number(this.wdu) >= 180) {
        this.$message.error('您输入的经纬度不合法，请重新输入')
      } else {
        this.inputData.push([this.jwdzsjz(Number(this.jdu), Number(this.jfen), Number(this.jmiao)), this.jwdzsjz(Number(this.wdu), Number(this.wfen), Number(this.wmiao))])
        this.jdu = '', this.jfen = '', this.jmiao = '', this.wdu = '', this.wfen = '', this.wmiao = '';
        this.manyindex = 1;
        if (this.hzgeometrytype == 'line') {
          this.hzgeometry = new LineString(this.inputData);
          console.log(this.hzgeometry.getFirstCoordinate())
          this.baogao.longitude0 = '东经：' + this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[0].toFixed(6));
          this.baogao.latitude0 = '北纬：' + this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[1].toFixed(6));
          this.baogao.longitude1 = '东经：' + this.jwdzshjz(this.hzgeometry.getLastCoordinate()[0].toFixed(6));
          this.baogao.latitude1 = '北纬：' + this.jwdzshjz(this.hzgeometry.getLastCoordinate()[1].toFixed(6));
          this.baogao.length = formatLength(this.hzgeometry);
        } else {
          this.hzgeometry = new Polygon([this.inputData]);
          this.baogao.longitude0 = '东经：' + this.jwdzshjz(olExtent.getCenter(this.hzgeometry.getExtent())[0].toFixed(6));
          this.baogao.latitude0 = '北纬：' + this.jwdzshjz(olExtent.getCenter(this.hzgeometry.getExtent())[1].toFixed(6));
          this.baogao.area = formatArea(this.hzgeometry);
        }
        map.getView().fit(this.hzgeometry, { maxZoom: 14.5 });
        map.getView().setZoom(map.getView().getZoom() - 0.5)
        source.addFeature(new Feature(this.hzgeometry))
        this.dialogVisibletype = false
      }

    },
    async kjct() {
      if (this.hzgeometry == '') {
        return this.$message.error('请先绘制或导入几何信息！')
      }
      this.huanPingFrom.yuanQuResult = [];
      this.huanPingFrom.yuanQuName = [];
      this.huanPingFrom.yuanQuBm = [];
      this.huanPingFrom.yuanQuShiTuan = [];
      this.huanPingFrom.yuanQuChanYe = [];
      var lineParam = new QueryByGeometryParameters({
        queryParams: this.layerData,
        geometry: this.hzgeometry
      });
      loading = this.$loading({
        lock: true,
        text: '智能研判中...',
        spinner: 'el-icon-loading',
        background: 'rgba(0, 0, 0, 0.7)'
      });
      new QueryService(this.url).queryByGeometry(lineParam, (serviceResult) => {
        console.log(serviceResult)
        var jishu = 0;
        if (this.hzgeometrytype == 'line' || this.hzgeometrytype == 'reo') {
          map.getView().fit(this.hzgeometry, { maxZoom: 14.5 });
          map.getView().setZoom(map.getView().getZoom() - 0.5)
          // map.getView().setZoom(13);
        } else {
          map.getView().setZoom(13);
          map.getView().setCenter(olExtent.getCenter(this.hzgeometry.getExtent()))
        }
        hxSource.clear();
        dxSource.clear();
        dxSource2.clear();
        sxSource.clear();
        yxSource.clear();
        zdSource.clear();
        ybSource.clear();
        stbqSource.clear();
        shuibqSource.clear();
        daqibqSource.clear();
        ziranbqSource.clear();
        yxdybqSource.clear();
        ybdybqSource.clear();
        zddybqSource.clear();
        this.hxfenxi = [];
        this.dxfenxi = [];
        this.sxfenxi = [];
        this.guiZeLayer = [];
        this.guiZeForm.name = [];
        this.danYuanBm = [];
        this.shengTaiTuan = [];
        this.yaoSuLayerGuiZe = [];
        this.yaoSuData = [];
        this.danYuanBm = [];
        this.hxGuize = [];
        this.baogao.sydname = [];
        this.baogao.shidiname = [];
        this.baogao.sczname = [];
        this.baogao.dxsname = [];
        this.baogao.dxscity = [];
        this.baogao.shuiqitaname = [];
        this.baogao.shuiqitacity = [];
        this.yuanQuBm = [];
        this.baogao.shengtaiData = [];
        this.baogao.shuiData = [];
        this.baogao.daqiData = [];
        this.baogao.ziranData = [];
        this.baogao.tuan = [];
        this.ishxandshui = false;
        this.baogao.division = '';
        this.shengtaiBm = [];
        this.shuiBm = [];
        this.daqiBm = [];
        this.ziranziyuanBm = [];
        var xzqhdata = []
        Object.keys(this.DanYuanFrom).forEach(key => this.DanYuanFrom[key] = '');
        Object.keys(this.ShengTaiForm).forEach(key => this.ShengTaiForm[key] = '');
        this.danYuanData = [];
        for (let x = 0; x < serviceResult.result.recordsets.length; x++) {
          if (serviceResult.result.recordsets[x].features.features.length != 0) {
            //重点生态功能区模块
            //this.shengTaiTuan.push(serviceResult.result.recordsets[x].features.features[0].properties.COUNTY);
            //要素图层管控要求
            //图层规则整合模块
            if (serviceResult.result.recordsets[x].datasetName.split('@')[0] == 'EcoRedline兵团') {
              this.ishxandshui = true;
              this.guiZeLayer.push('生态保护红线');
              for (let hx = 0; hx < serviceResult.result.recordsets[x].features.features.length; hx++) {
                this.hxGuize.push(serviceResult.result.recordsets[x].features.features[hx].properties.HJYSGKFQMC);
              }
              this.hxGuize = [...new Set(this.hxGuize)];
              this.guiZeForm.name.push('生态保护红线');
            }
            if (serviceResult.result.recordsets[x].datasetName.split('@')[0] == 'HydroPriority兵团') {
              this.ishxandshui = true;
              for (let i = 0; i < serviceResult.result.recordsets[x].features.features.length; i++) {
                if (serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC.indexOf("水源地") != -1) {
                  this.guiZeLayer.push('水源地');
                  this.baogao.sydname.push(serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC);
                  this.guiZeForm.name.push('水源地');
                } else if (serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC.indexOf("湿地") != -1 && serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC.indexOf("自然保护区") != -1) {
                  this.guiZeLayer.push('湿地自然保护区');
                  this.baogao.shidiname.push(serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC);
                  this.guiZeForm.name.push('湿地自然保护区')
                } else if (serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC.indexOf("水产种质资源保护区") != -1) {
                  this.guiZeLayer.push('水产种质资源保护区');
                  this.baogao.sczname.push(serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC);
                  this.guiZeForm.name.push('水产种质资源保护区');
                }
              }
              console.log('保护区：')
              console.log(this.guiZeForm.name)
              this.baogao.sydname = [...new Set(this.baogao.sydname)]
              this.baogao.shidiname = [...new Set(this.baogao.shidiname)];
              this.baogao.sczname = [...new Set(this.baogao.sczname)];
            }
            if (serviceResult.result.recordsets[x].datasetName.split('@')[0] == 'NRKeyHighPolluFuelForbid兵团') {
              //this.guiZeLayer.push('高污染燃料禁燃区');
              this.guiZeForm.name.push('高污染燃料禁燃区')
            }
            if (serviceResult.result.recordsets[x].datasetName.split('@')[0] == 'NRKeyGroundWaterExploKey兵团') {
              for (let i = 0; i < serviceResult.result.recordsets[x].features.features.length; i++) {
                this.baogao.dxsname.push(serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC)
                this.baogao.dxscity.push(serviceResult.result.recordsets[x].features.features[i].properties.CITY)
              }
              this.baogao.dxsname = [...new Set(this.baogao.dxsname)];
              this.baogao.dxscity = [...new Set(this.baogao.dxscity)];
            }

            if (serviceResult.result.recordsets[x].datasetName.split('@')[0] == 'HydroKeyOther兵团') {
              for (let i = 0; i < serviceResult.result.recordsets[x].features.features.length; i++) {
                this.baogao.shuiqitaname.push(serviceResult.result.recordsets[x].features.features[i].properties.HJYSGKFQMC);
                this.baogao.shuiqitacity.push(serviceResult.result.recordsets[x].features.features[i].properties.CITY);
              }
              this.baogao.shuiqitaname = [...new Set(this.baogao.dxsname)];
              this.baogao.shuiqitacity = [...new Set(this.baogao.dxscity)];
            }
            if (serviceResult.result.recordsets[x].features.features[0].properties.HJGKDYBM) {
              if (this.hzgeometrytype == 'line' || this.hzgeometrytype == 'reo') {
                for (let i = 0; i < serviceResult.result.recordsets[x].features.features.length; i++) {
                  xzqhdata.push(serviceResult.result.recordsets[x].features.features[i].properties.CITY + serviceResult.result.recordsets[x].features.features[i].properties.COUNTY)
                  this.baogao.tuan.push(serviceResult.result.recordsets[x].features.features[i].properties.COUNTY);
                  this.danYuanBm.push(serviceResult.result.recordsets[x].features.features[i].properties.HJGKDYBM);
                }

              } else {
                this.baogao.division = serviceResult.result.recordsets[x].features.features[0].properties.CITY + serviceResult.result.recordsets[x].features.features[0].properties.COUNTY;
                this.baogao.tuan.push(serviceResult.result.recordsets[x].features.features[0].properties.COUNTY);
                //单元管控要求模块
                this.danYuanBm.push(serviceResult.result.recordsets[x].features.features[0].properties.HJGKDYBM);
              }
              for (let i = 0; i < serviceResult.result.recordsets[x].features.features.length; i++) {
                if (serviceResult.result.recordsets[x].features.features[i].properties.GKDYFL == "1") {
                  console.log((new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features.features[i]))
                  var yxfeature = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features.features[i])[0];
                  yxSource.addFeature(yxfeature);
                  var fea1 = new Feature({
                    geometry: new Point([olExtent.getCenter(yxfeature.getGeometry().getExtent())[0], olExtent.getCenter(yxfeature.getGeometry().getExtent())[1]]),
                    HJYSGKFQMC: yxfeature.values_.HJGKDYMC
                  });
                  fea1.setStyle(createyxdyStyle(fea1))
                  yxdybqSource.addFeature(fea1)
                }
                else if (serviceResult.result.recordsets[x].features.features[i].properties.GKDYFL == "2") {
                  var zdfeature = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features.features[i])[0];
                  zdSource.addFeature(zdfeature);
                  var fea1 = new Feature({
                    geometry: new Point([olExtent.getCenter(zdfeature.getGeometry().getExtent())[0], olExtent.getCenter(zdfeature.getGeometry().getExtent())[1]]),
                    HJYSGKFQMC: zdfeature.values_.HJGKDYMC
                  });
                  fea1.setStyle(createzddyStyle(fea1))
                  zddybqSource.addFeature(fea1)
                }
                else if (serviceResult.result.recordsets[x].features.features[i].properties.GKDYFL == "3") {
                  var ybfeature = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features.features[i])[0];
                  ybSource.addFeature(ybfeature);
                  var fea1 = new Feature({
                    geometry: new Point([olExtent.getCenter(ybfeature.getGeometry().getExtent())[0], olExtent.getCenter(ybfeature.getGeometry().getExtent())[1]]),
                    HJYSGKFQMC: ybfeature.values_.HJGKDYMC
                  });
                  fea1.setStyle(createybdyStyle(fea1))
                  ybdybqSource.addFeature(fea1)
                }
              }
            } else {
              this.yaoSuLayerGuiZe.push(serviceResult.result.recordsets[x].datasetName);
              if (serviceResult.result.recordsets[x].features.features[0].properties.HJYS == "1") {
                var hxfeatures = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features);
                for (let o = 0; o < hxfeatures.length; o++) {
                  this.yuanQuBm.push(hxfeatures[o].values_.HJYSGKFQBM);
                  //要素的分析
                  this.shengtaiBm.push(hxfeatures[o].values_.HJYSGKFQBM);
                  hxfeatures[o].setId(hxfeatures[o].values_.HJYSGKFQBM);
                  //hxfeatures[o].setStyle(createStStyle(hxfeatures[o]))
                  var fea1 = new Feature({
                    geometry: new Point([olExtent.getCenter(hxfeatures[o].getGeometry().getExtent())[0], olExtent.getCenter(hxfeatures[o].getGeometry().getExtent())[1]]),
                    HJYSGKFQMC: hxfeatures[o].values_.HJYSGKFQMC
                  });
                  fea1.setStyle(createStStyle(fea1))
                  stbqSource.addFeature(fea1)
                  hxSource.addFeature(hxfeatures[o]);
                  this.baogao.shengtaiData.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, filename: serviceResult.result.recordsets[x].datasetName })
                  this.hxfenxi.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, feature: serviceResult.result.recordsets[x].features.features[o], bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, leibie: serviceResult.result.recordsets[x].features.features[o].properties.YSXL })
                }
                if (this.hxfenxi.length == 0) {
                  this.hxShow = true;
                } else {
                  this.hxShow = false;
                }
              }
              if (["2", "3", "4"].toString().indexOf(serviceResult.result.recordsets[x].features.features[0].properties.HJYS) > -1) {
                var dxfeatures = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features);
                for (let o = 0; o < dxfeatures.length; o++) {
                  this.yuanQuBm.push(dxfeatures[o].values_.HJYSGKFQBM);
                  if (serviceResult.result.recordsets[x].features.features[0].properties.HJYS == '2') {
                    dxfeatures[o].setId(dxfeatures[o].values_.HJYSGKFQBM);
                    //dxfeatures[o].setStyle(createshuiStyle(dxfeatures[o]))
                    this.shuiBm.push(dxfeatures[o].values_.HJYSGKFQBM)
                    var fea1 = new Feature({
                      geometry: new Point([olExtent.getCenter(dxfeatures[o].getGeometry().getExtent())[0], olExtent.getCenter(dxfeatures[o].getGeometry().getExtent())[1]]),
                      HJYSGKFQMC: dxfeatures[o].values_.HJYSGKFQMC
                    });
                    fea1.setStyle(createshuiStyle(fea1))
                    shuibqSource.addFeature(fea1)
                    dxSource.addFeature(dxfeatures[o]);
                    this.baogao.shuiData.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, filename: serviceResult.result.recordsets[x].datasetName })
                  } else if (serviceResult.result.recordsets[x].features.features[0].properties.HJYS == '3') {
                    dxfeatures[o].setId(dxfeatures[o].values_.HJYSGKFQBM);
                    this.daqiBm.push(dxfeatures[o].values_.HJYSGKFQBM)
                    var fea1 = new Feature({
                      geometry: new Point([olExtent.getCenter(dxfeatures[o].getGeometry().getExtent())[0], olExtent.getCenter(dxfeatures[o].getGeometry().getExtent())[1]]),
                      HJYSGKFQMC: dxfeatures[o].values_.HJYSGKFQMC
                    });
                    fea1.setStyle(createdaqiStyle(fea1))
                    daqibqSource.addFeature(fea1)
                    //s dxfeatures[o].setStyle(createdaqiStyle(dxfeatures[o]))
                    dxSource2.addFeature(dxfeatures[o]);
                    this.baogao.daqiData.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, filename: serviceResult.result.recordsets[x].datasetName })
                  }
                  this.dxfenxi.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, feature: serviceResult.result.recordsets[x].features.features[o], bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, leibie: serviceResult.result.recordsets[x].features.features[o].properties.YSXL })
                }
                if (this.dxfenxi.length == 0) {
                  this.dxShow = true;
                } else {
                  this.dxShow = false;
                }
              }
              if (serviceResult.result.recordsets[x].features.features[0].properties.HJYS == "5") {
                var sxfeatures = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features);
                for (let o = 0; o < sxfeatures.length; o++) {
                  this.yuanQuBm.push(sxfeatures[o].values_.HJYSGKFQBM);
                  this.ziranziyuanBm.push(sxfeatures[o].values_.HJYSGKFQBM)
                  sxfeatures[o].setId(sxfeatures[o].values_.HJYSGKFQBM);
                  var fea1 = new Feature({
                    geometry: new Point([olExtent.getCenter(sxfeatures[o].getGeometry().getExtent())[0], olExtent.getCenter(sxfeatures[o].getGeometry().getExtent())[1]]),
                    HJYSGKFQMC: sxfeatures[o].values_.HJYSGKFQMC
                  });
                  fea1.setStyle(createziranStyle(fea1))
                  ziranbqSource.addFeature(fea1)
                  //sxfeatures[o].setStyle(createziranStyle(sxfeatures[o]))
                  sxSource.addFeature(sxfeatures[o]);
                  this.baogao.ziranData.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, filename: serviceResult.result.recordsets[x].datasetName })
                  this.sxfenxi.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, feature: serviceResult.result.recordsets[x].features.features[o], bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, leibie: serviceResult.result.recordsets[x].features.features[o].properties.YSXL })
                }
                if (this.sxfenxi.length == 0) {
                  this.sxShow = true;
                } else {
                  this.sxShow = false;
                }
              }
            }
          } else {
            jishu++;
            if (jishu == serviceResult.result.recordsets.length) {
              this.$message.error('您的项目点位未落在兵团区域，无法判断，请重新输入项目坐标');
              return loading.close();
            }
          }
        };
        xzqhdata = [...new Set(xzqhdata)];
        for (let j = 0; j < xzqhdata.length; j++) {
          if (j == xzqhdata.length - 1) {
            this.baogao.division += xzqhdata[j]
          } else {
            this.baogao.division += xzqhdata[j] + ' ||';
          }
        }
        this.guiZeForm.name = [...new Set(this.guiZeForm.name)]
        //this.shengTaiGongNeng();
        /*var circleIn3857 = new Circle(transform(this.hzgeometry.getCoordinates(), 'EPSG:4326', 'EPSG:3857'), 3000,'XY');
        var circleIn4326 = circleIn3857.transform('EPSG:3857','EPSG:4326');
        yuanSource.addFeature(new Feature(circleIn4326));*/
        this.guiZe();
        this.yuanqufenx();
        this.yaoSu();
        this.danYuan();
        this.drawImg();
      });
      //联控分析
      var lineParam2 = new QueryByGeometryParameters({
        queryParams: { name: 'liankong' },
        geometry: this.hzgeometry
      });
      new QueryService(this.liankongurl).queryByGeometry(lineParam2, (serviceResult) => {
        console.log(serviceResult.result)
        let resname = '';
        if (serviceResult.result.totalCount !== 0) {
          for (let i in serviceResult.result.recordsets[0].features.features) {
            resname += '“' + serviceResult.result.recordsets[0].features.features[i].properties.名称 + '”，'
          }
          this.baogao.liankong = '该项目位于' + resname + '根据《兵团打赢蓝天保卫战三年行动计划》（2018-2020年），在大气联防联控区域内所有新（改、扩）建项目应执行最严格的大气污染物排放标准；PM2.5年平均浓度不达标的城市禁止新（改、扩）建未落实二氧化硫、氮氧化物、烟粉尘、挥发性有机物（VOCs）等四项大气污染物总量指标倍量替代的项目。严格落实大气联防联控区域二氧化硫、氮氧化物、颗粒物、挥发性有机物（VOCs）全面执行大气污染物特别排放限值要求。各师市城市建成区原则上不再新建每小时35蒸吨以下的燃煤锅炉，其他地区原则上不再新建每小时10蒸吨以下的燃煤锅炉。大气联防联控区域内各有关师市城市建成区以及国家级、兵团级工业园区禁止新建每小时65蒸吨以下燃煤锅炉。'
        } else {
          this.baogao.liankong = '该项目没有位于大气联防联控区'
        }
      });
      //畜禽养殖分析
      if(this.isxuqin){
        let xuqinData=[]
        var xuqinParam = new QueryByGeometryParameters({
          queryParams: { name: 'jinxianyang@sxydyangzhi' },
          geometry: this.hzgeometry
        });
        new QueryService(this.xuqinurl).queryByGeometry(xuqinParam, (serviceResult) => {
          if (serviceResult.result.totalCount !== 0) {
            for (let i in serviceResult.result.recordsets[0].features.features) {
              if(serviceResult.result.recordsets[0].features.features[i].properties.禁限养=='限养区'){
                xuqinData.push('限养区')
              }
              if(serviceResult.result.recordsets[0].features.features[i].properties.禁限养=='禁养区'){
                xuqinData.push('禁养区')
              }
            }
            xuqinData=Array.from(new Set(xuqinData))
            if(xuqinData.length==1){
              if(xuqinData[0]=='限养区'){
                this.baogao.xuqin = '该项目落位于畜禽养殖限养区范围内，不符合畜禽养殖行业相关选址布局要求。限养区域禁止新建规模化畜禽养殖场；限养区内现有的畜禽养殖场应限期治理，污染物处理达到排放要求。'
              }else if(xuqinData[0]=='禁养区'){
                this.baogao.xuqin = '该项目落位于畜禽养殖禁养区范围内，不符合畜禽养殖行业相关选址布局要求。禁养区域禁止建设养殖场或禁止建设有污染物排放的养殖场的区域。'
              }
            }else if(xuqinData.length==2){
              this.baogao.xuqin = '该项目落位于畜禽养殖限养区和禁养区范围内，不符合畜禽养殖行业相关选址布局要求。限养区域禁止新建规模化畜禽养殖场；限养区内现有的畜禽养殖场应限期治理，污染物处理达到排放要求。禁养区域禁止建设养殖场或禁止建设有污染物排放的养殖场的区域。'
            }
          } else {
            this.baogao.xuqin = '该项目未落位于畜禽养殖禁养区/畜禽养殖限养区内，符合畜禽养殖行业相关选址布局要求！'
          }
        });
      }else{
        this.baogao.xuqin='该项目不属于畜禽养殖类项目！'
      }
      
    },
    async tuiJian() {
      var tuiJianBm = [], layerData2 = [];
      if (this.huanPingFrom.weiYiId != '') {
        const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/industrialPark/findAllByIndustryCode/' + this.huanPingFrom.weiYiId)
        if (result.data.length != 0) {
          for (let i = 0; i < result.data.length; i++) {
            tuiJianBm.push("'" + result.data[i].hjysgkfqbm + "'");
          }
          const { data: result1 } = await this.$http2.get('/services/map-shp-sxydshp/rest/maps/sxydshp/layers/sxydshp.rjson')
          for (let x in result1.subLayers.layers) {
            if (x % 2 != 0) {
              if (result1.subLayers.layers[x].name.split('@')[0] != "IntergratedControlUnit兵团") {
                layerData2.push({ name: result1.subLayers.layers[x].name, attributeFilter: `HJYSGKFQBM in (${[...tuiJianBm]})` })
              }
            }
          }
          var param = new QueryBySQLParameters({
            queryParams: layerData2,
          });
          new QueryService(this.url).queryBySQL(param, (serviceResult) => {
            map.updateSize();
            hxSource.clear();
            dxSource.clear();
            dxSource2.clear();
            sxSource.clear();
            yxSource.clear();
            zdSource.clear();
            ybSource.clear();
            this.hxfenxi = [];
            this.dxfenxi = [];
            this.sxfenxi = [];
            for (let x = 0; x < serviceResult.result.recordsets.length; x++) {
              if (serviceResult.result.recordsets[x].features.features.length != 0) {
                if (serviceResult.result.recordsets[x].features.features[0].properties.HJGKDYBM) {
                } else {
                  if (serviceResult.result.recordsets[x].features.features[0].properties.HJYS == "1") {
                    var hxfeatures = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features);
                    for (let o = 0; o < hxfeatures.length; o++) {
                      hxfeatures[o].setId(hxfeatures[o].values_.HJYSGKFQBM);

                      hxSource.addFeature(hxfeatures[o]);
                      this.hxfenxi.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, feature: serviceResult.result.recordsets[x].features.features[o], bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, leibie: serviceResult.result.recordsets[x].features.features[o].properties.YSXL })
                    }
                    if (this.hxfenxi.length == 0) {
                      this.hxShow = true;
                    } else {
                      this.hxShow = false;
                    }
                  }
                  if (["2", "3", "4"].toString().indexOf(serviceResult.result.recordsets[x].features.features[0].properties.HJYS) > -1) {
                    var dxfeatures = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features);
                    for (let o = 0; o < dxfeatures.length; o++) {
                      dxfeatures[o].setId(dxfeatures[o].values_.HJYSGKFQBM);
                      dxSource.addFeature(dxfeatures[o]);
                    }
                  }
                  if (serviceResult.result.recordsets[x].features.features[0].properties.HJYS == "5") {
                    var sxfeatures = (new GeoJSON()).readFeatures(serviceResult.result.recordsets[x].features);
                    for (let o = 0; o < sxfeatures.length; o++) {
                      sxfeatures[o].setId(sxfeatures[o].values_.HJYSGKFQBM);
                      sxSource.addFeature(sxfeatures[o])
                      this.sxfenxi.push({ name: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQMC, feature: serviceResult.result.recordsets[x].features.features[o], bm: serviceResult.result.recordsets[x].features.features[o].properties.HJYSGKFQBM, leibie: serviceResult.result.recordsets[x].features.features[o].properties.YSXL })
                    }
                    if (this.sxfenxi.length == 0) {
                      this.sxShow = true;
                    } else {
                      this.sxShow = false;
                    }
                  }
                }
              } else {
              }
            };
          });
        } else {
          this.$message.error('该名录类别没有推荐的园区可以选择')
        }

      } else {
        this.$message.error('请选择管理名录类别后再进行推荐分析')
      }
    },
    async shengTaiGongNeng() {
      if ([...new Set(this.shengTaiTuan)].length > 0) {
        var tuan = [...new Set(this.shengTaiTuan)][0];
        const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/ecologyArea/findAllByCounty/' + tuan);
        if (result.data.length > 0) {
          this.ShengTaiForm.type = result.data[0].type;
          this.ShengTaiForm.quHua = result.data[0].region;
          this.ShengTaiForm.GongNengQuName = result.data[0].prohibitArea;
          this.ShengTaiForm.level = result.data[0].level;
          this.ShengTaiForm.shuXing = result.data[0].attribute;
          this.ShengTaiForm.faZhan = result.data[0].developmentDirection;
        } else {
          this.ShengTaiForm.type = '';
          this.ShengTaiForm.quHua = '';
          this.ShengTaiForm.GongNengQuName = '';
          this.ShengTaiForm.level = '';
          this.ShengTaiForm.shuXing = '';
          this.ShengTaiForm.faZhan = '';
        }
      }
    },
    async guiZe() {


    },
    async yuanqufenx() {
      //之前版本
      //管理名录分析园区
      // if (this.huanPingFrom.weiYiId) {
      //   const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/industrialPark/findAllByIndustryCode/' + this.huanPingFrom.weiYiId)
      //   if (result.data.length != 0) {
      //     this.tabledata = [];
      //     this.tabledata2 = [];
      //     /*for(let j=0;j<result.data.length;j++){
      //       yuanQuBm2.push(result.data[j].hjysgkfqbm);
      //     }*/
      //     //let intersection = yuanQuBm.filter(function (val) { return yuanQuBm2.indexOf(val) > -1 });
      //     for (let j = 0; j < result.data.length; j++) {
      //       this.huanPingFrom.yuanQuName.push(result.data[j].hjysgkfqmc);
      //       this.huanPingFrom.yuanQuBm.push(result.data[j].hjysgkfqbm);
      //       this.huanPingFrom.yuanQuShiTuan.push(result.data[j].city + '/' + result.data[j].county);
      //       this.huanPingFrom.yuanQuChanYe.push(result.data[j].industry);
      //       var qitadata1 = [];
      //       const { data: result231 } = await this.$http.get('/v1.0/resultIntegration/rule/industrialPark/findAllIndustryByGkdybh/' + result.data[j].hjysgkfqbm);
      //       for (let index1 in result231.data) {
      //         qitadata1.push(result231.data[index1].industry)
      //       }
      //       this.tabledata2.push({ yqname: result.data[j].hjysgkfqmc, yqbm: result.data[j].hjysgkfqbm, yqshi: result.data[j].city, yqtuan: result.data[j].county, yqdingwei: result.data[j].industry, qitachanye: qitadata1.join('、') });
      //     }
      //     this.huanPingFrom.yuanQuChanYe = [...new Set(this.huanPingFrom.yuanQuChanYe)]
      //     for (let i = 0; i < this.yuanQuBm.length; i++) {
      //       for (let x = 0; x < result.data.length; x++) {
      //         if (this.yuanQuBm[i] == result.data[x].hjysgkfqbm) {
      //           this.huanPingFrom.yuanQuResult.push(result.data[x].hjysgkfqmc)
      //           var qitadata = [];
      //           const { data: result23 } = await this.$http.get('/v1.0/resultIntegration/rule/industrialPark/findAllIndustryByGkdybh/' + this.yuanQuBm[i]);
      //           for (let index1 in result23.data) {
      //             qitadata.push(result23.data[index1].industry)
      //           }
      //           this.tabledata.push({ yqname: result.data[x].hjysgkfqmc, yqbm: result.data[x].hjysgkfqbm, yqshi: result.data[x].city, yqtuan: result.data[x].county, yqdingwei: result.data[x].industry, qitachanye: qitadata.join('、') });
      //         }
      //       }
      //     }
      //   }
      // } else {
      //   this.$message.error('您还未新增项目类别信息，故无法为您研判出管理名录相关结果')
      // }
      //9.22新版本
      if (this.huanPingFrom.weiYiId) {
        if (this.huanPingFrom.isYuanqu == 1) {
          const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/industrialPark/findAllByIndustryCode/' + this.huanPingFrom.weiYiId)
          if (result.data.length != 0) {
            var geometryParam = new GetFeaturesByGeometryParameters({
              datasetNames: ["HydroKeyIndustry兵团:HydroKeyIndustry兵团"],
              geometry: this.hzgeometry,
              spatialQueryMode: "INTERSECT"
            });
            let jishu = 0;
            new FeatureService(this.dataurl).getFeaturesByGeometry(geometryParam, (serviceResult) => {
              console.log(serviceResult.type)
              if (serviceResult.type == "processFailed") {
                console.log('error')
              } else {
                console.log('success')
                if (serviceResult.result.featureCount == 0) {
                  this.baogao.yuanqu = '建议进一步复核该项目与园区规划和规划环评批复文件的相符性。'
                } else {
                  for (let i in serviceResult.result.features.features) {
                    for (let j in result.data) {
                      if (serviceResult.result.features.features[i].properties.HJYSGKFQBM == result.data[j].hjysgkfqbm) {
                        jishu++
                        console.log(jishu)
                        var Param = new GetFeaturesByGeometryParameters({
                          datasetNames: ["yuanqu:园区功能分区"],
                          geometry: this.hzgeometry,
                          spatialQueryMode: "INTERSECT"
                        });
                       // let jishu = 0;
                        new FeatureService(this.yuanquurl).getFeaturesByGeometry(Param, (serviceResult2) => {
                          if (serviceResult.result.featureCount == 0) {
                            this.baogao.yuanqu = '初步判定，项目可落位于' + serviceResult.result.features.features[i].properties.HJYSGKFQMC + '内,请进一步复核该项目与园区规划和规划环评批复文件的相符性。'
                          } else {
                                for(let x in serviceResult2.result.features.features){
                                  console.log(serviceResult2.result.features.features[i].properties['编码'])
                                  console.log(serviceResult.result.features.features[i].properties.HJYSGKFQBM)
                                  if(serviceResult2.result.features.features[i].properties['编码']==serviceResult.result.features.features[i].properties.HJYSGKFQBM){
                                    this.baogao.yuanqu = '初步判定，项目可落位于' + serviceResult.result.features.features[i].properties.HJYSGKFQMC + '(' + serviceResult2.result.features.features[x].properties['功能分区'] + ')内,请进一步复核该项目与园区规划和规划环评批复文件的相符性。'
                                    console.log(this.baogao.yuanqu )
                                  }
                                }
                              }
                          })
                        // var sqlParam = new GetFeaturesBySQLParameters({
                        //   queryParameter: {
                        //     name: "园区功能分区@yuanqu",
                        //     attributeFilter: "'编码' = " + serviceResult.result.features.features[i].properties.HJYSGKFQBM
                        //   },
                        //   datasetNames: ["yuanqu:园区功能分区"]
                        // });
                        // //目前就只研判一个区域相符合
                        // new FeatureService(this.yuanquurl).getFeaturesBySQL(sqlParam,(serviceResult2) => {
                        //   console.log(serviceResult2)
                        //   if (serviceResult2.result.featureCount == 0) {
                        //     this.baogao.yuanqu = '初步判定，项目可落位于' + serviceResult.result.features.features[i].properties.HJYSGKFQMC + '内,请进一步复核该项目与园区规划和规划环评批复文件的相符性。'
                        //   } else {
                        //     this.baogao.yuanqu = '初步判定，项目可落位于' + serviceResult.result.features.features[i].properties.HJYSGKFQMC + '(' + serviceResult2.result.features.features[0].properties['功能分区'] + ')内,请进一步复核该项目与园区规划和规划环评批复文件的相符性。'
                        //   }
                        // });
                      }
                    }
                  }
                  if (jishu == 0) {
                    let tongshiyuanqu = []
                    for (let x in result.data) {
                      if (result.data[x].city == serviceResult.result.features.features[0].properties.CITY) {
                        tongshiyuanqu.push(result.data[x].hjysgkfqmc)
                      }
                    }
                    let tongshiyuanqu2 = ''
                    for (let y in tongshiyuanqu) {
                      if (y == tongshiyuanqu.length - 1) {
                        tongshiyuanqu2 = tongshiyuanqu2 + tongshiyuanqu[y]
                      } else {
                        tongshiyuanqu2 = tongshiyuanqu2 + tongshiyuanqu[y] + '||'
                      }
                    }
                    if (tongshiyuanqu.length == 0) {
                      this.baogao.yuanqu = '建议进一步复核该项目与园区规划和规划环评批复文件的相符性。'
                    } else {
                      this.baogao.yuanqu = '初步判定，项目选址不符合' + serviceResult.result.features.features[0].properties.HJYSGKFQMC + '的产业布局,建议在' + tongshiyuanqu2 + '内选址布局，并进一步复核该项目与对应园区规划和规划环评批复文件的相符性。'
                    }
                  }
                }
              }

            })
          } else {
            this.baogao.yuanqu = '建议进一步复核该项目与园区规划和规划环评批复文件的相符性。'
          }
        } else if (this.huanPingFrom.isYuanqu == 2) {
          const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/industrialPark/findAllByIndustryCode/' + this.huanPingFrom.weiYiId)
          if (result.data.length != 0) {
            var geometryParam = new GetFeaturesByGeometryParameters({
              datasetNames: ["HydroKeyIndustry兵团:HydroKeyIndustry兵团"],
              geometry: this.hzgeometry,
              spatialQueryMode: "INTERSECT"
            });
            let jishu = 0;
            new FeatureService(this.dataurl).getFeaturesByGeometry(geometryParam, (serviceResult) => {
              if (serviceResult.result.featureCount == 0) {
                this.baogao.yuanqu = '该项目建议在团场布局。建设单位应及时履行环保手续，严格落实各项污染防治措施和生态环境保护措施。'
              } else {
                console.log(serviceResult.result)
                for (let i in serviceResult.result.features.features) {
                  for (let j in result.data) {
                    if (serviceResult.result.features.features[i].properties.HJYSGKFQBM == result.data[j].hjysgkfqbm) {
                      jishu++
                      this.baogao.yuanqu = '初步判定，项目可落位于' + serviceResult.result.features.features[i].properties.HJYSGKFQMC + '内,请进一步复核该项目与园区规划和规划环评批复文件的相符性。项目也可在团场布局，建设单位应及时履行环保手续，严格落实各项污染防治措施和生态环境保护措施'
                    }
                  }
                }
                if (jishu == 0) {
                  this.baogao.yuanqu = '该项目建议在团场布局。建设单位应及时履行环保手续，严格落实各项污染防治措施和生态环境保护措施'
                }
              }
            })
          } else {
            this.baogao.yuanqu = '建议进一步复核该项目与园区规划和规划环评批复文件的相符性。'
          }
        } else {
          this.baogao.yuanqu = '项目不属于工业类！'
        }

      } else {
        this.$message.error('您还未新增项目类别信息，故无法为您研判出管理名录相关结果')
      }
      console.log(this.baogao.yuanqu)
    },
    async yaoSu() {
      //var ysdata1=['生态','水','大气','自然资源'];
      /*  var cedata1=[this.baogao.shengtaiData,this.baogao.shuiData,this.baogao.daqiData,this.baogao.ziranData];
        if(this.hzgeometrytype=='line' || this.hzgeometrytype=='reo'){
          if(cedata1[0][0]){
            for(let x=0; x<cedata1.length;x++){
              for(let y=0;y<cedata1[x].length;y++){
                const {data:result}= await this.$http.get('/v1.0/resultIntegration/rule/layerFeatures/findByName/'+cedata1[x][y].filename.split('@')[0].substring(0,cedata1[x][y].filename.split('@')[0].length-2))
                if(result.status=='3000'){
                  this.yaoSuData.push({luodianname:cedata1[x][y].name,luodianbm:cedata1[x][y].bm,name:result.data.name,unitClassify:result.data.unitClassify,environmentFeatures:result.data.environmentFeatures,detailFeatures:result.data.detailFeatures
                    ,spaceRestrain:(result.data.spaceRestrain==null?'无':result.data.spaceRestrain),pollutantRestrain:(result.data.pollutantRestrain==null?'无':result.data.pollutantRestrain),environmentRestrain:(result.data.environmentRestrain==null?'无':result.data.environmentRestrain),resourceUtilization:(result.data.resourceUtilization==null?'无':result.data.resourceUtilization)
                    ,remarks:(result.data.remarks==null?'无':result.data.remarks)})
                }
              }
            }
          }
        }else {
          if(this.yaoSuLayerGuiZe[0]){
            for(let i=0;i<this.yaoSuLayerGuiZe.length;i++){
              //const {data:result}= await this.$http.get('/v1.0/resultIntegration/achievements/layerFeatures/findByName/'+this.yaoSuLayerGuiZe[i].substring(0,this.yaoSuLayerGuiZe[i].length-2));
              const {data:result}= await this.$http.get('/v1.0/resultIntegration/rule/layerFeatures/findByName/'+this.yaoSuLayerGuiZe[i].split('@')[0].substring(0,this.yaoSuLayerGuiZe[i].split('@')[0].length-2))
              if(result.status=='3000'){
                this.yaoSuData.push({luodianname:cedata1[i][0].name,luodianbm:cedata1[i][0].bm,name:result.data.name,unitClassify:result.data.unitClassify,environmentFeatures:result.data.environmentFeatures,detailFeatures:result.data.detailFeatures
                  ,spaceRestrain:(result.data.spaceRestrain==null?'无':result.data.spaceRestrain),pollutantRestrain:(result.data.pollutantRestrain==null?'无':result.data.pollutantRestrain),environmentRestrain:(result.data.environmentRestrain==null?'无':result.data.environmentRestrain),resourceUtilization:(result.data.resourceUtilization==null?'无':result.data.resourceUtilization)
                  ,remarks:(result.data.remarks==null?'无':result.data.remarks)})
              }
            }
          }
        }*/
      this.shengtaiTable = [];
      this.shuiTable = [];
      this.daqiTable = [];
      this.ziranziyuanTable = [];
      for (let a in this.shengtaiBm) {
        const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/ecologicalSpaceRule/findByCode/' + this.shengtaiBm[a])
        if (result.status == '3000') {
          var stjson = result.data;
          stjson.spaceRestrain = stjson.spaceRestrain == null ? '无' : result.data.spaceRestrain;
          stjson.pollutantRestrain = stjson.pollutantRestrain == null ? '无' : result.data.pollutantRestrain;
          stjson.environmentRestrain = stjson.environmentRestrain == null ? '无' : result.data.environmentRestrain;
          stjson.resourceUtilization = stjson.resourceUtilization == null ? '无' : result.data.resourceUtilization;
          this.shengtaiTable.push(stjson)
        }
      }
      for (let b in this.shuiBm) {
        const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/environmentWaterRule/findByCode/' + this.shuiBm[b])
        if (result.status == '3000') {
          var stjson = result.data;
          stjson.spaceRestrain = stjson.spaceRestrain == null ? '无' : result.data.spaceRestrain;
          stjson.pollutantRestrain = stjson.pollutantRestrain == null ? '无' : result.data.pollutantRestrain;
          stjson.environmentRestrain = stjson.environmentRestrain == null ? '无' : result.data.environmentRestrain;
          stjson.resourceUtilization = stjson.resourceUtilization == null ? '无' : result.data.resourceUtilization;
          this.shuiTable.push(stjson)
        }
      }
      for (let c in this.daqiBm) {
        const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/atmosphereRule/findByCode/' + this.daqiBm[c])
        if (result.status == '3000') {
          var stjson = result.data;
          stjson.spaceRestrain = stjson.spaceRestrain == null ? '无' : result.data.spaceRestrain;
          stjson.pollutantRestrain = stjson.pollutantRestrain == null ? '无' : result.data.pollutantRestrain;
          stjson.environmentRestrain = stjson.environmentRestrain == null ? '无' : result.data.environmentRestrain;
          stjson.resourceUtilization = stjson.resourceUtilization == null ? '无' : result.data.resourceUtilization;
          this.daqiTable.push(stjson)
        }
      }
      for (let d in this.ziranziyuanBm) {
        const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/environmentResourceRule/findByCode/' + this.ziranziyuanBm[d])
        if (result.status == '3000') {
          var stjson = result.data;
          stjson.spaceRestrain = stjson.spaceRestrain == null ? '无' : result.data.spaceRestrain;
          stjson.pollutantRestrain = stjson.pollutantRestrain == null ? '无' : result.data.pollutantRestrain;
          stjson.environmentRestrain = stjson.environmentRestrain == null ? '无' : result.data.environmentRestrain;
          stjson.resourceUtilization = stjson.resourceUtilization == null ? '无' : result.data.resourceUtilization;
          this.ziranziyuanTable.push(stjson)
        }
      }
    },
    async danYuan() {
      if (this.danYuanBm.length > 0) {
        for (let i = 0; i < this.danYuanBm.length; i++) {
          const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/dataPresentation/text/findByUnitCode/' + this.danYuanBm[i]);
          if (result.data) {
            this.danYuanData.push({
              dybm: result.data.unitCode, dymc: result.data.unitName, sheng: result.data.province, xian: result.data.regiment, dyfl: result.data.unitClassify, dybj: (result.data.spaceRestrain == null ? '无' : result.data.spaceRestrain), dywrw: (result.data.pollutantRestrain == null ? '无' : result.data.pollutantRestrain)
              , dyhj: (result.data.environmentRestrain == null ? '无' : result.data.environmentRestrain), dyzy: (result.data.resourceUtilization == null ? '无' : result.data.resourceUtilization)
            })
            if (i == 0) {
              this.DanYuanFrom.bianMa = result.data.unitCode;
              this.DanYuanFrom.name = result.data.unitName;
              this.DanYuanFrom.sheng = result.data.province;
              this.DanYuanFrom.shi = result.data.division;
              this.DanYuanFrom.xian = result.data.regiment;
              this.DanYuanFrom.type = result.data.unitClassify;
              this.DanYuanFrom.kongJianYueSu = (result.data.spaceRestrain == null ? '无' : result.data.spaceRestrain)
              this.DanYuanFrom.wuRanWu = (result.data.pollutantRestrain == null ? '无' : result.data.pollutantRestrain)
              this.DanYuanFrom.huanJingFengXian = (result.data.environmentRestrain == null ? '无' : result.data.environmentRestrain);
              this.DanYuanFrom.ziYuanKaiFa = (result.data.resourceUtilization == null ? '无' : result.data.resourceUtilization);
            }
          }
        }
      }
    },
    drawImg() {
      tdtyxzjLayer.setVisible(false);
      tdtbqLayer.setVisible(true)
      yxLayer.setVisible(true);
      zdLayer.setVisible(true);
      ybLayer.setVisible(true);
      hxLayer.setVisible(true);
      dxLayer.setVisible(true);
      dxLayer2.setVisible(true);
      sxLayer.setVisible(true);
      stbqLayer.setVisible(false);
      shuibqLayer.setVisible(false);
      daqibqLayer.setVisible(false);
      ziranbqLayer.setVisible(false);
      yxdybqLayer.setVisible(false);
      ybdybqLayer.setVisible(false);
      zddybqLayer.setVisible(false);
      map.once('rendercomplete', () => {
        var mapCanvas = document.createElement('canvas');
        var size = map.getSize();
        mapCanvas.width = size[0];
        mapCanvas.height = size[1];
        var mapContext = mapCanvas.getContext('2d');
        Array.prototype.forEach.call(
          document.querySelectorAll('.ol-layer canvas'),
          function (canvas) {
            if (canvas.width > 0) {
              var opacity = canvas.parentNode.style.opacity;
              mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
              var transform = canvas.style.transform;
              // Get the transform parameters from the style's transform matrix
              var matrix = transform
                .match(/^matrix\(([^\(]*)\)$/)[1]
                .split(',')
                .map(Number);
              // Apply the transform to the export map context
              CanvasRenderingContext2D.prototype.setTransform.apply(
                mapContext,
                matrix
              );
              mapContext.drawImage(canvas, 0, 0);
            }
          }
        );

        if (navigator.msSaveBlob) {
          // link download attribuute does not work on MS browsers
          navigator.msSaveBlob(mapCanvas.msToBlob(), 'map.png');
        } else {
          //var link = document.getElementById('image-download');
          //link.href = mapCanvas.toDataURL();
          document.getElementById("tup").src = mapCanvas.toDataURL();
          const viewer = new Viewer(document.getElementById('tup'), {
            //inline: true,
            viewed() {
              viewer.zoomTo(1);
            },
          });
          //link.click();
        }
        this.drawImgDy();
      });
    },
    drawImgDy() {
      yxLayer.setVisible(true);
      zdLayer.setVisible(true);
      ybLayer.setVisible(true);
      hxLayer.setVisible(false);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(false);
      stbqLayer.setVisible(false);
      shuibqLayer.setVisible(false);
      daqibqLayer.setVisible(false);
      ziranbqLayer.setVisible(false);
      yxdybqLayer.setVisible(true);
      ybdybqLayer.setVisible(true);
      zddybqLayer.setVisible(true);

      map.once('rendercomplete', () => {
        setTimeout(() => {
          var mapCanvas1 = document.createElement('canvas');
          var size = map.getSize();
          mapCanvas1.width = size[0];
          mapCanvas1.height = size[1];
          var mapContext = mapCanvas1.getContext('2d');
          Array.prototype.forEach.call(
            document.querySelectorAll('.ol-layer canvas'),
            function (canvas) {
              if (canvas.width > 0) {
                var opacity = canvas.parentNode.style.opacity;
                mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
                var transform = canvas.style.transform;
                // Get the transform parameters from the style's transform matrix
                var matrix = transform
                  .match(/^matrix\(([^\(]*)\)$/)[1]
                  .split(',')
                  .map(Number);
                // Apply the transform to the export map context
                CanvasRenderingContext2D.prototype.setTransform.apply(
                  mapContext,
                  matrix
                );
                mapContext.drawImage(canvas, 0, 0);
              }
            }
          );
          if (navigator.msSaveBlob) {
            // link download attribuute does not work on MS browsers
            navigator.msSaveBlob(mapCanvas1.msToBlob(), 'map1.png');
          } else {
            //var link = document.getElementById('image-download');
            //link.href = mapCanvas.toDataURL();
            document.getElementById("tup1").src = mapCanvas1.toDataURL();
            const viewer = new Viewer(document.getElementById('tup1'), {
              //inline: true,
              viewed() {
                viewer.zoomTo(1);
              },
            });
            //link.click();
          }
          this.drawImgHx();

        }, 500)
      });
    },
    drawImgHx() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(true);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(false);
      stbqLayer.setVisible(true);
      shuibqLayer.setVisible(false);
      daqibqLayer.setVisible(false);
      ziranbqLayer.setVisible(false);
      yxdybqLayer.setVisible(false);
      ybdybqLayer.setVisible(false);
      zddybqLayer.setVisible(false);
      /*   hxbiaoqianSource=new Label("labelThemeLayer", {
           map: map,
           attributions: " ",
           style: new ThemeStyle({
             labelRect: true,
             fontColor: "#000000",
             fontWeight: "bolder",
             fontSize: "18px",
             fill: true,
             fillColor: "red",
             fillOpacity: 1,
             stroke: false,
             strokeColor: "#8B7B8B"
           }),
           themeField: "HJYSGKFQBM",
         });
         var themeLayer = new ImageLayer({
           source: hxbiaoqianSource
         });
         map.addLayer(themeLayer);
         hxbiaoqianSource.addFeatures(hxSource.getFeatures())*/

      map.once('rendercomplete', () => {
        setTimeout(() => {
          var mapCanvas1 = document.createElement('canvas');
          var size = map.getSize();
          mapCanvas1.width = size[0];
          mapCanvas1.height = size[1];
          var mapContext = mapCanvas1.getContext('2d');
          Array.prototype.forEach.call(
            document.querySelectorAll('.ol-layer canvas'),
            function (canvas) {
              if (canvas.width > 0) {
                var opacity = canvas.parentNode.style.opacity;
                mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
                var transform = canvas.style.transform;
                // Get the transform parameters from the style's transform matrix
                var matrix = transform
                  .match(/^matrix\(([^\(]*)\)$/)[1]
                  .split(',')
                  .map(Number);
                // Apply the transform to the export map context
                CanvasRenderingContext2D.prototype.setTransform.apply(
                  mapContext,
                  matrix
                );
                mapContext.drawImage(canvas, 0, 0);
              }
            }
          );

          if (navigator.msSaveBlob) {
            // link download attribuute does not work on MS browsers
            navigator.msSaveBlob(mapCanvas1.msToBlob(), 'map2.png');
          } else {
            //var link = document.getElementById('image-download');
            //link.href = mapCanvas.toDataURL();
            document.getElementById("tup2").src = mapCanvas1.toDataURL();
            const viewer = new Viewer(document.getElementById('tup2'), {
              //inline: true,
              viewed() {
                viewer.zoomTo(1);
              },
            });
            //link.click();
          }
          this.drawImgDx();

        }, 300)
      });
    },
    drawImgDx() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(false);
      dxLayer.setVisible(true);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(false);
      stbqLayer.setVisible(false);
      shuibqLayer.setVisible(true);
      daqibqLayer.setVisible(false);
      ziranbqLayer.setVisible(false);
      yxdybqLayer.setVisible(false);
      ybdybqLayer.setVisible(false);
      zddybqLayer.setVisible(false);
      map.once('rendercomplete', () => {
        setTimeout(() => {
          var mapCanvas1 = document.createElement('canvas');
          var size = map.getSize();
          mapCanvas1.width = size[0];
          mapCanvas1.height = size[1];
          var mapContext = mapCanvas1.getContext('2d');
          Array.prototype.forEach.call(
            document.querySelectorAll('.ol-layer canvas'),
            function (canvas) {
              if (canvas.width > 0) {
                var opacity = canvas.parentNode.style.opacity;
                mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
                var transform = canvas.style.transform;
                // Get the transform parameters from the style's transform matrix
                var matrix = transform
                  .match(/^matrix\(([^\(]*)\)$/)[1]
                  .split(',')
                  .map(Number);
                // Apply the transform to the export map context
                CanvasRenderingContext2D.prototype.setTransform.apply(
                  mapContext,
                  matrix
                );
                mapContext.drawImage(canvas, 0, 0);
              }
            }
          );
          if (navigator.msSaveBlob) {
            // link download attribuute does not work on MS browsers
            navigator.msSaveBlob(mapCanvas1.msToBlob(), 'map3.png');
          } else {
            //var link = document.getElementById('image-download');
            //link.href = mapCanvas.toDataURL();
            document.getElementById("tup3").src = mapCanvas1.toDataURL();
            const viewer = new Viewer(document.getElementById('tup3'), {
              //inline: true,
              viewed() {
                viewer.zoomTo(1);
              },
            });
            //link.click();
          }
          this.drawImgDx2();
        }, 300)
      });
    },
    drawImgDx2() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(false);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(true);
      sxLayer.setVisible(false);
      stbqLayer.setVisible(false);
      shuibqLayer.setVisible(false);
      daqibqLayer.setVisible(true);
      ziranbqLayer.setVisible(false);
      yxdybqLayer.setVisible(false);
      ybdybqLayer.setVisible(false);
      zddybqLayer.setVisible(false);
      map.once('rendercomplete', () => {
        setTimeout(() => {
          var mapCanvas1 = document.createElement('canvas');
          var size = map.getSize();
          mapCanvas1.width = size[0];
          mapCanvas1.height = size[1];
          var mapContext = mapCanvas1.getContext('2d');
          Array.prototype.forEach.call(
            document.querySelectorAll('.ol-layer canvas'),
            function (canvas) {
              if (canvas.width > 0) {
                var opacity = canvas.parentNode.style.opacity;
                mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
                var transform = canvas.style.transform;
                // Get the transform parameters from the style's transform matrix
                var matrix = transform
                  .match(/^matrix\(([^\(]*)\)$/)[1]
                  .split(',')
                  .map(Number);
                // Apply the transform to the export map context
                CanvasRenderingContext2D.prototype.setTransform.apply(
                  mapContext,
                  matrix
                );
                mapContext.drawImage(canvas, 0, 0);
              }
            }
          );

          if (navigator.msSaveBlob) {
            // link download attribuute does not work on MS browsers
            navigator.msSaveBlob(mapCanvas1.msToBlob(), 'map4.png');
          } else {
            //var link = document.getElementById('image-download');
            //link.href = mapCanvas.toDataURL();
            document.getElementById("tup4").src = mapCanvas1.toDataURL();
            const viewer = new Viewer(document.getElementById('tup4'), {
              //inline: true,
              viewed() {
                viewer.zoomTo(1);
              },
            });
            //link.click();
          }
          this.drawImgSx();
        }, 300)
      });


    },
    drawImgSx() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(false);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(true);
      stbqLayer.setVisible(false);
      shuibqLayer.setVisible(false);
      daqibqLayer.setVisible(false);
      ziranbqLayer.setVisible(true);
      yxdybqLayer.setVisible(false);
      ybdybqLayer.setVisible(false);
      zddybqLayer.setVisible(false);
      map.once('rendercomplete', () => {
        setTimeout(() => {
          var mapCanvas1 = document.createElement('canvas');
          var size = map.getSize();
          mapCanvas1.width = size[0];
          mapCanvas1.height = size[1];
          var mapContext = mapCanvas1.getContext('2d');
          Array.prototype.forEach.call(
            document.querySelectorAll('.ol-layer canvas'),
            function (canvas) {
              if (canvas.width > 0) {
                var opacity = canvas.parentNode.style.opacity;
                mapContext.globalAlpha = opacity === '' ? 1 : Number(opacity);
                var transform = canvas.style.transform;
                // Get the transform parameters from the style's transform matrix
                var matrix = transform
                  .match(/^matrix\(([^\(]*)\)$/)[1]
                  .split(',')
                  .map(Number);
                // Apply the transform to the export map context
                CanvasRenderingContext2D.prototype.setTransform.apply(
                  mapContext,
                  matrix
                );
                mapContext.drawImage(canvas, 0, 0);
              }
            }
          );

          if (navigator.msSaveBlob) {
            // link download attribuute does not work on MS browsers
            navigator.msSaveBlob(mapCanvas1.msToBlob(), 'map5.png');
          } else {
            //var link = document.getElementById('image-download');
            //link.href = mapCanvas.toDataURL();
            document.getElementById("tup5").src = mapCanvas1.toDataURL();
            const viewer = new Viewer(document.getElementById('tup5'), {
              //inline: true,
              viewed() {
                viewer.zoomTo(1);
              },
            });
            //link.click();
          }
          yxLayer.setVisible(true);
          zdLayer.setVisible(true);
          ybLayer.setVisible(true);
          hxLayer.setVisible(true);
          dxLayer.setVisible(true);
          dxLayer2.setVisible(true);
          sxLayer.setVisible(true);
          ziranbqLayer.setVisible(false);
          setTimeout(() => {
            loading.close();
            if (this.guiZeLayer.length != 0) {
              /* var guiZeName=[...new Set(this.guiZeLayer)];
               for(let i=0;i<guiZeName.length;i++){
                 var  {data:result}= await this.$http.get('/v1.0/resultIntegration/rule/vectorRules/findAllByContent/'+guiZeName[i]);
                 for(let i=0;i<result.data.length;i++){
                   this.guiZeForm.guiZeData.push(result.data[i]);
                 }
               }*/
              this.guiZedialogVisible = true;
            }
          }, 1000)
        });
      });
    },
    showShp(geo) {
      for (var item in geo) {
        source.addFeature((new GeoJSON()).readFeature(geo[item]))
      }
      let g = source.getFeatures()[0].getGeometry()
      console.log(g)
      if (g instanceof LineString || g instanceof MultiLineString) {
        this.hzgeometrytype = 'line'
      }
      else if (g instanceof Polygon || g instanceof MultiPolygon) {
        this.hzgeometrytype = 'reo'
      }
      else if (g instanceof Point) {
        this.hzgeometrytype = 'point'
      }
      this.hzgeometry = source.getFeatures()[0].getGeometry();
      if (this.hzgeometrytype == 'reo') {
        this.baogao.longitude0 = '东经：' + this.jwdzshjz(olExtent.getCenter(this.hzgeometry.getExtent())[0].toFixed(6));
        this.baogao.latitude0 = '北纬：' + this.jwdzshjz(olExtent.getCenter(this.hzgeometry.getExtent())[1].toFixed(6));
      } else if (this.hzgeometrytype == 'line') {
        this.baogao.longitude0 = '东经：' + this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[0].toFixed(6));
        this.baogao.latitude0 = '北纬：' + this.jwdzshjz(this.hzgeometry.getFirstCoordinate()[1].toFixed(6));
        this.baogao.longitude1 = '东经：' + this.jwdzshjz(this.hzgeometry.getLastCoordinate()[0].toFixed(6));
        this.baogao.latitude1 = '北纬：' + this.jwdzshjz(this.hzgeometry.getLastCoordinate()[1].toFixed(6));
      } else {
        this.baogao.longitude = '东经：' + this.jwdzshjz(this.hzgeometry.flatCoordinates[0].toFixed(6));
        this.baogao.latitude = '北纬：' + this.jwdzshjz(this.hzgeometry.flatCoordinates[1].toFixed(6));
      }
      console.log(this.hzgeometry.getExtent())
      /*    var x=source.getExtent()[0];
       var y=source.getExtent()[1];
       var x1=source.getExtent()[2];
       var y1=source.getExtent()[3];
       var polygon=new Polygon([[[x,y],[x1,y],[x1,y1],[x,y1]]])
       var polygonSource = new VectorSource({
         features: [new Feature(polygon)],
         wrapX: false
       });
      var  vectorLayer = new VectorLayer({
         source: polygonSource,
         style: new Style({
           stroke: new Stroke({
             color: 'blue',
             width: 3
           }),
           fill: new Fill({
             color: 'rgba(0, 0, 255, 0.1)'
           })
         })
       });
       map.addLayer(vectorLayer);*/
      map.getView().fit(source.getExtent());
    },
    async buffer(type, num) {
      var juli = num / (map.getView().getProjection().getMetersPerUnit());
      map.updateSize();
      hxSource.clear();
      dxSource.clear();
      sxSource.clear();
      yxSource.clear();
      zdSource.clear();
      ybSource.clear();
      this.hxfenxi = [];
      this.dxfenxi = [];
      this.sxfenxi = [];
      const { data: result } = await this.$http2.get('/services/data-shp-tmsk/rest/data/datasources.rjson')
      var dataName = [];
      for (let i = 0; i < result.datasourceNames.length; i++) {
        dataName.push(result.datasourceNames[i] + ":" + result.datasourceNames[i])
      }
      var bufferParam = new GetFeaturesByBufferParameters({
        datasetNames: dataName,
        bufferDistance: juli,
        geometry: this.hzgeometry
      });
      new FeatureService(this.dataurl).getFeaturesByBuffer(bufferParam, (serviceResult) => {
        for (let x = 0; x < serviceResult.result.features.features.length; x++) {
          if (serviceResult.result.features.features[x].properties.HJGKDYBM) {
          } else {

            if (serviceResult.result.features.features[x].properties.HJYS == "1") {
              var hxfeature = (new GeoJSON()).readFeature(serviceResult.result.features.features[x]);
              hxSource.addFeature(hxfeature);

              this.hxfenxi.push({ name: serviceResult.result.features.features[x].properties.HJYSGKFQMC, feature: serviceResult.result.features.features[x] })
              if (this.hxfenxi.length == 0) {
                this.hxShow = true;
              } else {
                this.hxShow = false;
              }
            }
            if (["2", "3", "4"].toString().indexOf(serviceResult.result.features.features[x].properties.HJYS) > -1) {
              var dxfeature = (new GeoJSON()).readFeature(serviceResult.result.features.features[x]);
              dxSource.addFeature(dxfeature);
              this.dxfenxi.push({ name: serviceResult.result.features.features[x].properties.HJYSGKFQMC, feature: serviceResult.result.features.features[x] })
              if (this.dxfenxi.length == 0) {
                this.dxShow = true;
              } else {
                this.dxShow = false;
              }
            }
            if (serviceResult.result.features.features[x].properties.HJYS == "5") {
              var sxfeature = (new GeoJSON()).readFeature(serviceResult.result.features.features[x]);
              sxSource.addFeature(sxfeature)
              this.sxfenxi.push({ name: serviceResult.result.features.features[x].properties.HJYSGKFQMC, feature: serviceResult.result.features.features[x] })
              if (this.sxfenxi.length == 0) {
                this.sxShow = true;
              } else {
                this.sxShow = false;
              }
            }
          }
        }
        //bufferSource.addFeatures((new GeoJSON()).readFeatures(serviceResult.result.features))
      });
    },
    ceju() {
      zhuangtai = 0;
      map.on('pointermove', pointerMoveHandler);
      map.on('click', function (evt) {
        if (zhuangtai == 1) {
          return;
        }
        var coordinate = evt.coordinate; //鼠标单击点的坐标
        if (output == "0") {
          lastPolygonLabelFeature = null;
          if (lastLengthLabelFeature) {
            source.removeFeature(lastLengthLabelFeature);
            lastLengthLabelFeature = null;
          }
          return;
        }
        var Coord;
        if (sketch) {
          var geom = sketch.getGeometry();
          if (geom instanceof Polygon) {
            if (lastPolygonLabelFeature) {
              source.removeFeature(lastPolygonLabelFeature);
            }
            Coord = geom.getInteriorPoint().getCoordinates();    //新建一个要素ol.Feature
            var newFeature = Feature({
              geometry: new Point(Coord), //几何信息
              name: output
            });
            lastPolygonLabelFeature = newFeature;
            newFeature.setStyle(createLabelStyle(newFeature, 0, 0)); //设置要素样式
            source.addFeature(newFeature);
          } else if (geom instanceof LineString) {
            Coord = geom.getLastCoordinate();  //新建一个要素ol.Feature
            var newFeature = new Feature({
              geometry: new Point(Coord), //几何信息
              name: output
            });
            newFeature.setStyle(createLabelStyle(newFeature, 35, -10)); //设置要素样式
            source.addFeature(newFeature);
          }
          var pointFeature = new Feature({
            geometry: new Point(coordinate), //几何信息
            name: output
          });
          source.addFeature(pointFeature);
        }
      });
      if (draw) {
        map.removeInteraction(draw);
      }
      this.addInteraction("length");
    },
    cemian() {
      sketch = null;
      zhuangtai = 1;
      map.on('pointermove', pointerMoveHandler);
      map.on('click', function (evt) {
        var coordinate = evt.coordinate; //鼠标单击点的坐标
        if (output == "0") {
          lastPolygonLabelFeature = null;
          if (lastLengthLabelFeature) {
            source.removeFeature(lastLengthLabelFeature);
            lastLengthLabelFeature = null;
          }
          return;
        }
        var Coord;
        if (sketch) {
          var geom = sketch.getGeometry();
          if (geom instanceof Polygon) {
            if (lastPolygonLabelFeature) {
              source.removeFeature(lastPolygonLabelFeature);
            }
            Coord = geom.getInteriorPoint().getCoordinates();    //新建一个要素ol.Feature
            var newFeature = new Feature({
              geometry: new Point(Coord), //几何信息
              name: output
            });
            lastPolygonLabelFeature = newFeature;
            newFeature.setStyle(createLabelStyle(newFeature, 0, 0)); //设置要素样式
            source.addFeature(newFeature);
          } else if (geom instanceof LineString) {
            Coord = geom.getLastCoordinate();  //新建一个要素ol.Feature

            var newFeature = new Feature({
              geometry: new Point(Coord), //几何信息
              name: output
            });
            newFeature.setStyle(createLabelStyle(newFeature, 35, -10)); //设置要素样式

            source.addFeature(newFeature);
          }
          var pointFeature = new Feature({
            geometry: new Point(coordinate), //几何信息
            name: output
          });
          source.addFeature(pointFeature);
        }
      });
      if (draw) {
        map.removeInteraction(draw);
      }
      this.addInteraction("area");
    },
    addInteraction(drawType) {
      var type = (drawType == 'area' ? 'Polygon' : 'LineString');
      draw = new Draw({
        source: source,
        type: type,
        style: new Style({
          fill: new Fill({
            color: 'rgba(255, 0, 0, 0.2)'
          }),
          stroke: new Stroke({
            color: 'rgb(255,116,3)',
            // lineDash: [10, 10],//虚线
            width: 2
          }),
          image: new CircleStyle({
            radius: 5,
            stroke: new Stroke({
              color: 'rgba(255, 0, 0, 0.1)'
            }),
            fill: new Fill({
              color: 'rgba(255,116,3, 0.3)'
            })
          })
        })
      });
      map.addInteraction(draw);
      var listener;
      draw.on('drawstart', function (evt) {  // set sketch
        sketch = evt.feature;
        listener = sketch.getGeometry().on('change', function (evt) {
          var geom = evt.target;
          if (geom instanceof Polygon) {
            output = formatArea(geom);
          } else if (geom instanceof LineString) {
            output = formatLength(geom);
          }
        });
      }, this);
      draw.on('drawend', function () {  // unset sketch
        sketch = null;
        unByKey(listener);
        output = "0";
        map.removeInteraction(draw);
      }, this);
    },
    qingchu() {
      map.removeInteraction(draw);
      source.clear();
      source1.clear();
      hxSource.clear();
      dxSource.clear();
      dxSource2.clear();
      sxSource.clear();
      yxSource.clear();
      zdSource.clear();
      ybSource.clear();
      gjSource.clear();
      lastPolygonLabelFeature = null;
      lastLengthLabelFeature = null;
      lastCircleLabelFeature = null;
      click = false;
      sketch = null;
      output = "0";
      pSource.clear();
    },
    clearInteraction() {
      if (draw) {
        map.removeInteraction(draw);
      }
    },
    yingxiang() {
      if (this.yingx == '影像') {
        tdtslLayer.setVisible(false);
        tdtbqLayer.setVisible(false);
        tdtyxLayer.setVisible(true);
        tdtyxzjLayer.setVisible(true);
        this.yingx = '矢量'
      } else if (this.yingx == '矢量') {
        tdtyxzjLayer.setVisible(false);
        tdtyxLayer.setVisible(false);
        tdtslLayer.setVisible(true);
        tdtbqLayer.setVisible(true);
        this.yingx = '影像'
      }
    },
    tuliShow() {
      this.tlbtnshow = false;
      this.tlshow = true;
    },
    closeTl() {
      this.tlbtnshow = true;
      this.tlshow = false;
    },
    handleClose(done) {
      this.$confirm('确认关闭？')
        .then(_ => {
          done();
        })
        .catch(_ => { });
    },
    changeShi(value) {
      switch (value) {
        case 'd1':
          map.getView().setCenter([81.277840902, 40.547068742]);
          map.getView().setZoom(9)
          break;
        case 'd2':
          map.getView().setCenter([85.672922222, 41.867275]);
          map.getView().setZoom(9)
          break;
        case 'd3':
          map.getView().setCenter([79.071925, 39.867719444]);
          map.getView().setZoom(9)
          break;
        case 'd4':
          map.getView().setCenter([81.037599507, 43.923116438]);
          map.getView().setZoom(9)
          break;
        case 'd5':
          map.getView().setCenter([82.069213889, 44.888722222]);
          map.getView().setZoom(9)
          break;
        case 'd6':
          map.getView().setCenter([87.540233359, 44.16617618]);
          map.getView().setZoom(9)
          break;
        case 'd7':
          map.getView().setCenter([84.901516667, 44.430636111]);
          map.getView().setZoom(9)
          break;
        case 'd8':
          map.getView().setCenter([86.07755, 44.303947222]);
          map.getView().setZoom(9)
          break;
        case 'd9':
          map.getView().setCenter([83.609342141, 46.517751008]);
          map.getView().setZoom(9)
          break;
        case 'd10':
          map.getView().setCenter([87.830919424, 47.325244407]);
          map.getView().setZoom(9)
          break;
        case 'd11':
          map.getView().setCenter([87.595465116, 43.857920905]);
          map.getView().setZoom(9)
          break;
        case 'd12':
          map.getView().setCenter([87.534985988, 43.913105002]);
          map.getView().setZoom(9)
          break;
        case 'd13':
          map.getView().setCenter([93.546963889, 42.825463889]);
          map.getView().setZoom(9)
          break;
        case 'd14':
          map.getView().setCenter([79.28838135, 37.209817352]);
          map.getView().setZoom(9)
          break;
        case 'd0':
          map.getView().setCenter([85.28838135, 42.209817352]);
          map.getView().setZoom(6)
          break;
      }
    },
    dialogClose() {
      this.$refs.addFormRef.resetFields();
    },
    dialogClose2() {
      this.nenghaoData = [
        {
          chanpingName: '',
          chanpingNum: '',
          chanpingValue: 0,
          estimateAmount: 1,
          wuziData: [],
          haonengwuziData: [{
            name: '',
            type: '1',
            num: '',
          }],
          nengyuanwuziData: [{
            name: '',
            type: '2',
            num: '',
          }],
          redianwuziData: [{
            name: '',
            type: '3',
            num: '',
          }],
          xiaohaoData: [],
          xiaohaoDatanengyuan: [{
            name: '',
            type: '2',
            num: '',
          }],
          xiaohaoDataredian: [{
            name: '',
            type: '3',
            num: '',
          }],
        }]
      this.fenxiresult = []
    },
    async firstChange(id) {
      this.isxuqin=(id.value==2)
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/eiaSecondCategory/findAllByEiaCategoryId/' + id.value);
      this.secondValue = '';
      this.secondDisabled = false;
      this.secondLevel = result.data;
    },
    async secondChange(id) {
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/projectCategory/findAllByCategorySecondId/' + id.value);
      this.form.thirdValue = '';
      this.thirdDisabled = false;
      this.thirdLevel = result.data;
    },
    async thridChange(dd) {
      console.log(dd)
      const { value, label, guiShu, fenLei, fenJi, tuanChangProj, tiaojian, isYuanqu, projectCategoryNum, categoryCondition } = dd;
      this.baogao.category_third = label;
      this.huanPingFrom.weiYiId = value;
      this.huanPingFrom.guiShu = guiShu;
      this.huanPingFrom.fenLei = fenLei;
      this.huanPingFrom.shenPi = fenJi;
      this.huanPingFrom.tuanChangProj = tuanChangProj;
      this.huanPingFrom.tiaojian = tiaojian;
      this.huanPingFrom.isYuanqu = isYuanqu;
      this.huanPingFrom.projectCategoryNum = projectCategoryNum;
      this.huanPingFrom.categoryCondition = categoryCondition;
    },
    async firstChanYeChange(id) {
      const { data: result } = await this.$http.get('/v1.0/resultIntegration/rule/industrialTechnology/findAllByCategoryId/' + id.value);
      this.form.secondChanYeValue = '';
      this.secondChanYeDisabled = false;
      this.secondChanYeLevel = result.data;
      const { data: result2 } = await this.$http.get('/v1.0/resultIntegration/rule/encourageCategory/findAllByCategoryId/' + id.value);
      this.chanYeFrom.xiBuDiQu = [];
      if (result2.data.length !== 0) {
        for (let i in result2.data) {
          this.chanYeFrom.xiBuDiQu.push(result2.data[i].subClass)
        }
      }
      const { data: result3 } = await this.$http.get('/v1.0/resultIntegration/rule/prohibitProject/findAllByCategoryId/' + id.value);
      this.chanYeFrom.jinZhiSanGao = [];
      if (result3.data.length !== 0) {
        for (let j in result3.data) {
          this.chanYeFrom.jinZhiSanGao.push(result3.data[j].prohibitCategory)
        }
      }
    },
    secondChanYeChange(dd) {
      const { id, pop } = dd;
      this.chanYeFrom.zhiDao = pop
    },
    addProject() {
      this.$refs.addFormRef.validate(async valid => {
        if (!valid) return
        this.projectInfo.name = this.form.name;
        this.addPrijInfo = this.form.name;
        this.projectInfo.huanPing = this.firstValue.label + "--" + this.secondValue.label;
        this.projectInfo.chanYe = this.firstChanYeValue.label + "--" + this.form.secondChanYeValue.label;
        //报告
        this.baogao.project_name = this.form.name;
        this.baogao.category_first = this.firstValue.label;
        this.baogao.category_second = this.secondValue.label;
        console.log(this.firstChanYeValue)
        if (this.firstChanYeValue != '') {
          this.baogao.industry_first = this.firstChanYeValue.label;
          this.baogao.industry_second = this.form.secondChanYeValue.label;
        } else {
          this.baogao.industry_first = '无';
          this.baogao.industry_second = '无';
        }

        this.addDialogFormVisible = false;
      })
    },
    addwuzi(obj) {
      obj.wuziData.push({
        name: '',
        type: '',
        num: '',
      })
    },
    addWuziHaoneng(obj) {
      obj.haonengwuziData.push({
        name: '',
        type: '1',
        num: '',
      })
    },
    addWuzinengyuan(obj) {
      obj.nengyuanwuziData.push({
        name: '',
        type: '2',
        num: '',
      })
    },
    addWuziredian(obj) {
      obj.redianwuziData.push({
        name: '',
        type: '3',
        num: '',
      })
    },
    addwuzijiannengyuan(obj) {
      obj.xiaohaoDatanengyuan.push({
        name: '',
        type: '2',
        num: '',
      })
    },
    addwuzijianredian(obj) {
      obj.xiaohaoDataredian.push({
        name: '',
        type: '3',
        num: '',
      })
    },
    removeWuzihaoneng(item, item2) {
      for (let i in item.haonengwuziData) {
        if (item.haonengwuziData[i] == item2) {
          item.haonengwuziData.splice(i, 1);
        }
      }
    },
    removeWuzinengyuan(item, item2) {
      for (let i in item.nengyuanwuziData) {
        if (item.nengyuanwuziData[i] == item2) {
          item.nengyuanwuziData.splice(i, 1);
        }
      }
    },
    removeWuziredian(item, item2) {
      for (let i in item.redianwuziData) {
        if (item.redianwuziData[i] == item2) {
          item.redianwuziData.splice(i, 1);
        }
      }
    },
    removeWuzi2nengyuan(item, item3) {
      for (let i in item.xiaohaoDatanengyuan) {
        if (item.xiaohaoDatanengyuan[i] == item3) {
          item.xiaohaoDatanengyuan.splice(i, 1);
        }
      }
    },
    removeWuzi2redian(item, item3) {
      for (let i in item.xiaohaoDataredian) {
        if (item.xiaohaoDataredian[i] == item3) {
          item.xiaohaoDataredian.splice(i, 1);
        }
      }
    },
    addchanping() {
      this.nenghaoData.push({
        chanpingName: '',
        chanpingNum: '',
        chanpingValue: 0,
        estimateAmount: 1,
        wuziData: [],
        haonengwuziData: [{
          name: '',
          type: '1',
          num: '',
        }],
        nengyuanwuziData: [{
          name: '',
          type: '2',
          num: '',
        }],
        redianwuziData: [{
          name: '',
          type: '3',
          num: '',
        }],
        xiaohaoData: [],
        xiaohaoDatanengyuan: [{
          name: '',
          type: '2',
          num: '',
        }],
        xiaohaoDataredian: [{
          name: '',
          type: '3',
          num: '',
        }],
      })
    },
    removeChanping(item) {
      for (let i in this.nenghaoData) {
        if (this.nenghaoData[i] == item) {
          this.nenghaoData.splice(i, 1);
        }
      }
    },
    nenghaofenxi() {
      console.log(this.nenghaoData)
      var haoneng = 0, nengyuan = 0, dianlidengliang = 0, dianlidangliang = 0, relidangliang = 0;
      var nengyuanjian = 0, dianlidengliangjian = 0, dianlidangliangjian = 0, relidangliangjian = 0
      for (let x in this.nenghaoData) {
        this.nenghaoData[x].wuziData = this.nenghaoData[x].haonengwuziData.concat(this.nenghaoData[x].nengyuanwuziData).concat(this.nenghaoData[x].redianwuziData)
        for (let i in this.nenghaoData[x].wuziData) {
          if (this.nenghaoData[x].wuziData[i].type == 1 && this.nenghaoData[x].wuziData[i].num != '') {
            haoneng += (Number(this.nenghaoData[x].wuziData[i].num) * Number(this.nenghaoData[x].wuziData[i].conversionCoefficient))
          } else if (this.nenghaoData[x].wuziData[i].type == 2 && this.nenghaoData[x].wuziData[i].num != '') {
            nengyuan += (Number(this.nenghaoData[x].wuziData[i].num) * Number(this.nenghaoData[x].wuziData[i].conversionCoefficient))
          } else if (this.nenghaoData[x].wuziData[i].type == 3 && this.nenghaoData[x].wuziData[i].num != '') {
            console.log(this.nenghaoData[x].wuziData[i].substance)
            if (this.nenghaoData[x].wuziData[i].substance == '电力（当量值/等价值）') {
              console.log(this.nenghaoData[x].wuziData[i].conversionCoefficient.split('/')[0])
              dianlidangliang += (Number(this.nenghaoData[x].wuziData[i].num) * Number(this.nenghaoData[x].wuziData[i].conversionCoefficient.split('/')[0]))
              dianlidengliang += (Number(this.nenghaoData[x].wuziData[i].num) * Number(this.nenghaoData[x].wuziData[i].conversionCoefficient.split('/')[1]))
            }
            else if (this.nenghaoData[x].wuziData[i].substance == '热力（当量值）') {
              relidangliang += (Number(this.nenghaoData[x].wuziData[i].num) * Number(this.nenghaoData[x].wuziData[i].conversionCoefficient))
            }
          }
        }
        this.nenghaoData[x].xiaohaoData = this.nenghaoData[x].xiaohaoDatanengyuan.concat(this.nenghaoData[x].xiaohaoDataredian)
        for (let j in this.nenghaoData[x].xiaohaoData) {
          if (this.nenghaoData[x].xiaohaoData[j].type == 2 && this.nenghaoData[x].xiaohaoData[j].num != '') {
            nengyuanjian += (Number(this.nenghaoData[x].xiaohaoData[j].num) * Number(this.nenghaoData[x].xiaohaoData[j].conversionCoefficient))
          } else if (this.nenghaoData[x].xiaohaoData[j].type == 3 && this.nenghaoData[x].xiaohaoData[j].num != '') {
            console.log(this.nenghaoData[x].xiaohaoData[j].substance)
            if (this.nenghaoData[x].xiaohaoData[j].substance == '电力（当量值/等价值）') {
              dianlidangliangjian += (Number(this.nenghaoData[x].xiaohaoData[j].num) * Number(this.nenghaoData[x].xiaohaoData[j].conversionCoefficient.split('/')[0]))
              dianlidengliangjian += (Number(this.nenghaoData[x].xiaohaoData[j].num) * Number(this.nenghaoData[x].xiaohaoData[j].conversionCoefficient.split('/')[1]))
            }
            else if (this.nenghaoData[x].xiaohaoData[j].substance == '热力（当量值）') {
              relidangliangjian += (Number(this.nenghaoData[x].xiaohaoData[j].num) * Number(this.nenghaoData[x].xiaohaoData[j].conversionCoefficient))
            }
          }
        }
      }
      console.log(haoneng)
      console.log(nengyuan)
      console.log(dianlidangliang)
      console.log(dianlidengliang)
      console.log(relidangliang)
      this.dangliangALL = haoneng + nengyuan + dianlidangliang + relidangliang;
      this.dengjiaALL = haoneng + nengyuan + dianlidengliang;
      this.nengyuandangliangALL = nengyuan + dianlidangliang + relidangliang;
      this.nengyuandengjiaALL = nengyuan + dianlidengliang;
      this.dangliangjianALL = nengyuanjian + dianlidangliangjian + relidangliangjian;
      this.dengjiajianALL = nengyuanjian + dianlidengliangjian;
      console.log(this.dangliangALL)
      console.log(this.dengjiaALL)
      console.log(this.nengyuandangliangALL)
      console.log(this.nengyuandengjiaALL)
      console.log(this.dangliangjianALL)
      console.log(this.dengjiajianALL)
      this.zhonghenenghaodangliang = ((this.dangliangALL - this.dangliangjianALL) / 1000).toFixed(4)
      this.zhonghenenghaodengjia = ((this.dengjiaALL - this.dengjiajianALL) / 1000).toFixed(4)
      this.zhonghenengyuandangliang = ((this.nengyuandangliangALL - this.dangliangjianALL) / 1000).toFixed(4)
      this.zhonghenengyuandengjia = ((this.nengyuandengjiaALL - this.dengjiajianALL) / 1000).toFixed(4)
      this.nengyuanhejidangliang = (this.nengyuandangliangALL / 1000).toFixed(4);
      this.nengyuanhejidengjia = (this.nengyuandengjiaALL / 1000).toFixed(4);
      this.fenxiresult = []
      this.fenxiresult.push({
        'nenghao': '综合能耗',
        'dangliang': this.zhonghenenghaodangliang,
        'dengjia': this.zhonghenenghaodengjia,
        'biaozhun': '50000',
        'unit': '吨标煤'
      })
      this.fenxiresult.push({
        'nenghao': '综合能源消费量',
        'dangliang': this.zhonghenengyuandangliang,
        'dengjia': this.zhonghenengyuandengjia,
        'biaozhun': '50000',
        'unit': '吨标煤'
      })
    },
    closePop() {
      this.popxy = false;
      this.popxy1 = false;
      this.popxy2 = false;
      selectSouce.clear();
    },
    base64DataURLToArrayBuffer(dataURL) {
      const base64Regex = /^data:image\/(png|jpg|svg|svg\+xml);base64,/;
      if (!base64Regex.test(dataURL)) {
        return false;
      }
      const stringBase64 = dataURL.replace(base64Regex, "");
      let binaryString;
      if (typeof window !== "undefined") {
        binaryString = window.atob(stringBase64);
      } else {
        binaryString = new Buffer(stringBase64, "base64").toString("binary");
      }
      const len = binaryString.length;
      const bytes = new Uint8Array(len);
      for (let i = 0; i < len; i++) {
        const ascii = binaryString.charCodeAt(i);
        bytes[i] = ascii;
      }
      return bytes.buffer;
    },
    async getBaoGao() {
      //基本分析
      if (this.huanPingFrom.fenLei == '报告表' || this.huanPingFrom.fenLei == '报告书') {
        console.log(this.huanPingFrom.shenPi)
        if (this.huanPingFrom.shenPi == '师市') {
          this.baogao.shenpitype = '项目环评类别及审批级别：项目应当编制' + this.huanPingFrom.fenLei + '，由';
          var shengtaidata = [];
          for (let t = 0; t < this.baogao.tuan.length; t++) {
            const { data: result1 } = await this.$http3.get('/v1.0/unit/find/city/findByCountyName/' + this.baogao.tuan[t]);
            if (result1.status == "3000") {
              if (result1.data.anotherName) {
                shengtaidata.push(result1.data.anotherName)
                /*if(t==this.baogao.length-1){
                  this.baogao.shenpitype+=result1.data.anotherName+'审批'
                }else {
                  this.baogao.shenpitype+=result1.data.anotherName+'、'
                }*/
              } else {
                if (shengtaidata.length == 0) {
                  this.baogao.shenpitype = '项目环评类别及审批级别：项目应当编制' + this.huanPingFrom.fenLei + '，由' + this.huanPingFrom.shenPi + '生态环境局审批'
                }
              }
            } else {
              //this.baogao.shenpitype='项目环评类别及审批级别：项目应当编制'+this.huanPingFrom.fenLei+'，由'+this.huanPingFrom.shenPi+'生态环境局审批'
            }
          }
          shengtaidata = [...new Set(shengtaidata)];
          if (shengtaidata.length == 1) {
            this.baogao.shenpitype += (shengtaidata[0] + '审批')
          } else {
            for (let s = 0; s < shengtaidata.length; s++) {
              if (s == shengtaidata.length - 1) {
                this.baogao.shenpitype += shengtaidata[s] + '中项目建设单位所在师的环境局来审批'
              } else {
                this.baogao.shenpitype += shengtaidata[s] + '、'
              }
            }
          }
          if(this.isxuqin){
            this.baogao.shenpitype +='（年出栏量5000头及以上的生猪养殖项目采用告知承诺审批流程）'
          }
        } else if (this.huanPingFrom.shenPi == '兵团') {
          this.baogao.shenpitype = '项目环评类别及审批级别：项目应当编制' + this.huanPingFrom.fenLei + '，由' + this.huanPingFrom.shenPi + '生态环境局审批'
        } else if (this.huanPingFrom.shenPi == '兵团（除生态环境部审批外的）') {
          this.baogao.shenpitype = '项目环评类别及审批级别：项目应当编制' + this.huanPingFrom.fenLei + '，由兵团生态环境局审批（除生态环境部审批外的）'
        }else {
          this.baogao.shenpitype = '项目环评类别及审批级别：项目应当编制' + this.huanPingFrom.fenLei + '，由' + this.huanPingFrom.shenPi+ '审批';
        }
      } else if (this.huanPingFrom.fenLei == '登记表') {
        this.baogao.shenpitype = '项目环评类别及审批级别：项目应当填写登记表，网址：http://220.171.32.30:7080/REG/a/login'
      } else {
        this.baogao.shenpitype = '项目环评类别及审批级别：项目不需要办理环评手续'
      }
      var ifirst1 = ''
      if (this.chanYeFrom.zhiDao == '鼓励类' || this.chanYeFrom.zhiDao == '限制类') {
        this.baogao.chanye = '项目所属产业研判结果:项目属于' + this.baogao.industry_first.split('、')[1] + '类产业' + this.chanYeFrom.zhiDao
        ifirst1 = this.baogao.industry_first.split('、')[1]
      } else if (this.chanYeFrom.zhiDao == '') {
        this.baogao.chanye = '项目所属产业研判结果:项目不属于' + this.baogao.industry_first.split('、')[1] + '类产业' + '鼓励类/限制类/淘汰类，且符合国家有关法律、法规和政策规定的为允许类'
        ifirst1 = this.baogao.industry_first.split('、')[1]
      } else if (this.chanYeFrom.zhiDao == '无') {
        this.chanYeFrom.chanyeShow = false
        this.baogao.chanye = '项目所属产业研判结果:本项目为允许类'
        ifirst1 = ''
      } else {
        ifirst1 = this.baogao.industry_first.split('、')[1]
        this.baogao.chanye = '项目所属产业研判结果:项目属于' + this.baogao.industry_first.split('、')[1] + '类产业' + '淘汰类'
      }
      //西部
      /* this.baogao.xibuchanye='《西部地区鼓励类产业目录》（2020年本）与该产业相关规定（鼓励类）为:'+'\r'
       if(this.chanYeFrom.xiBuDiQu.length!=0){
             for(let xi in this.chanYeFrom.xiBuDiQu){
               if(xi!=this.chanYeFrom.xiBuDiQu.length-1){
                 this.baogao.xibuchanye+=('    '+this.chanYeFrom.xiBuDiQu[xi]+'\r')
               }else {
                 this.baogao.xibuchanye+=('    '+this.chanYeFrom.xiBuDiQu[xi])
               }
             }
       }else {
         this.baogao.xibuchanye+='无'
       }*/
      var xibu = []
      if (this.chanYeFrom.xiBuDiQu.length != 0) {
        for (let xi in this.chanYeFrom.xiBuDiQu) {
          xibu.push({ xb: this.chanYeFrom.xiBuDiQu[xi] });
        }
      } else {
        xibu = [{ xb: '无' }]
      }
      var sangao = [];
      //三高
      /* this.baogao.sangaochanye='《自治区严禁“三高”项目进新疆推动经济高质量发展实施方案》与该产业相关规定（禁止类）为：'+'\r'
       if(this.chanYeFrom.jinZhiSanGao.length!=0){
         for(let jz in this.chanYeFrom.jinZhiSanGao){
           if(jz!=this.chanYeFrom.jinZhiSanGao.length-1){
             this.baogao.sangaochanye+=('    '+this.chanYeFrom.jinZhiSanGao[jz]+'\r')
           }else {
             this.baogao.sangaochanye+=('    '+this.chanYeFrom.jinZhiSanGao[jz])
           }

         }
       }else {
         this.baogao.sangaochanye+='无'
       }*/
      if (this.chanYeFrom.jinZhiSanGao.length != 0) {
        for (let jz in this.chanYeFrom.jinZhiSanGao) {
          sangao.push({ sg: this.chanYeFrom.jinZhiSanGao[jz] })
        }
      } else {
        sangao = [{ sg: '无' }]
      }
      //选址分析
      if (this.hxGuize.length != 0) {
        if (this.baogao.hongxiantype == '都不属于以上类别') {
          this.baogao.hongxian = '该项目涉及生态保护红线,属于生态保护红线属性表中“';
          for (let h = 0; h < this.hxGuize.length; h++) {
            if (h == this.hxGuize.length - 1) {
              this.baogao.hongxian += this.hxGuize[h] + '“原则上禁止建设。'
            } else {
              this.baogao.hongxian += (this.hxGuize[h] + '、');
            }
          }
        } else {
          this.baogao.hongxian = '该项目涉及生态保护红线,属于生态保护红线属性表中“';
          for (let h = 0; h < this.hxGuize.length; h++) {
            if (h == this.hxGuize.length - 1) {
              this.baogao.hongxian += this.hxGuize[h] + '“。属于' + this.baogao.hongxiantype + '原则上允许建设'
            } else {
              this.baogao.hongxian += (this.hxGuize[h] + '、');
            }
          }
        }
      } else {
        this.baogao.hongxian = '该项目不涉及生态保护红线。'
      }
      var syd = '该项目位于', shidi = '该项目位于', shuichanzhong = '该项目位于', dxs = '该项目位于', shuiqita = '该项目位于';
      if (this.baogao.sydtype) {
        if (this.baogao.sydtype == '都不属于以上类别') {
          for (let s = 0; s < this.baogao.sydname.length; s++) {
            if (s == this.baogao.sydname.length - 1) {
              syd += (this.baogao.sydname[s] + '内，原则上禁止建设。')
            } else {
              syd += (this.baogao.sydname[s] + '、')
            }
          }
        } else {
          for (let s = 0; s < this.baogao.sydname.length; s++) {
            if (s == this.baogao.sydname.length - 1) {
              syd += (this.baogao.sydname[s] + '内，属于' + this.baogao.sydtype + '原则上允许建设。')
            } else {
              syd += (this.baogao.sydname[s] + '、')
            }
          }
        }
      } else {
        syd = ''
      }
      if (this.baogao.shiditype) {
        console.log(this.baogao.shiditype)
        if (this.baogao.shiditype == '都不属于以上类别') {
          for (let s = 0; s < this.baogao.shidiname.length; s++) {
            if (s == this.baogao.shidiname.length - 1) {
              shidi += (this.baogao.shidiname[s] + '内，原则上禁止建设。')
            } else {
              shidi += (this.baogao.shidiname[s] + '、')
            }
          }
        } else {
          for (let s = 0; s < this.baogao.shidiname.length; s++) {
            if (s == this.baogao.shidiname.length - 1) {
              shidi += (this.baogao.shidiname[s] + '内，属于' + this.baogao.shiditype + '原则上允许建设。')
            } else {
              shidi += (this.baogao.shidiname[s] + '、')
            }
          }
        }
      } else {
        shidi = ''
      }
      if (this.baogao.scztype) {
        console.log(this.baogao.scztype)
        if (this.baogao.scztype == '都不属于以上类别') {
          for (let s = 0; s < this.baogao.sczname.length; s++) {
            if (s == this.baogao.sczname.length - 1) {
              shuichanzhong += (this.baogao.sczname[s] + '内，原则上禁止建设。')
            } else {
              shuichanzhong += (this.baogao.sczname[s] + '、')
            }
          }
        } else {
          for (let s = 0; s < this.baogao.sczname.length; s++) {
            if (s == this.baogao.sczname.length - 1) {
              shuichanzhong += (this.baogao.sczname[s] + '内，属于' + this.baogao.scztype + '原则上允许建设。')
            } else {
              shuichanzhong += (this.baogao.sczname[s] + '、')
            }
          }
        }
      } else {
        shuichanzhong = ''
      }
      if (this.huanPingFrom.projectCategoryNum == 233 && this.baogao.dxsname.length != 0) {
        for (let d = 0; d < this.baogao.dxsname.length; d++) {
          if (d == this.baogao.dxsname.length - 1) {
            dxs += (this.baogao.dxscity[d] + this.baogao.dxsname[d] + '，属于地下水开采类项目（农村分散式家庭生活自用水井除外），建议禁止建设。')
          } else {
            dxs += (this.baogao.dxscity[d] + this.baogao.dxsname[d] + '、')
          }
        }
      } else {
        dxs = ''
      }
      var leibiedata = [13, 14, 15, 16, 17, 18, 78, 79, 80];
      if (leibiedata.indexOf(this.huanPingFrom.projectCategoryNum) != -1 && this.baogao.shuiqitaname.length != 0) {
        for (let d = 0; d < this.baogao.shuiqitaname.length; d++) {
          if (d == this.baogao.shuiqitaname.length - 1) {
            shuiqita += (this.baogao.shuiqitacity[d] + this.baogao.shuiqitaname[d] + '，属于' + this.baogao.category_first + '。根据《新疆维吾尔自治区环境保护条例》（2018年9月21日修订）第三十条规定：任何单位和个人不得在水源涵养区、饮用水水源保护区内和河流、湖泊、水库周围建设重化工、涉重金属等工业污染项目；对已建成的工业污染项目，当地人民政府应当组织限期搬迁。因此，该项目建议禁止建设。');
          } else {
            shuiqita += (this.baogao.shuiqitacity[d] + this.baogao.shuiqitaname[d] + '、')
          }
        }
      } else {
        shuiqita = ''
      }
      if (syd == '' && dxs == '' && shuiqita == '') {
        syd = '该项目不涉及水源地'
      }
    
      if (shuichanzhong == '' && shidi == '') {
        shidi = '该项目不涉及保护区'
      }
      var biao = '', biaotitle = '', tableda = [];
      // if (this.huanPingFrom.isYuanqu == 1) {
      //   if (this.huanPingFrom.yuanQuResult.length > 0) {
      //     this.baogao.yuanqu = ' 该项目产业类型符合' + this.huanPingFrom.yuanQuResult[0] + '的产业定位,可考虑落位于该园区（园区基本信息见表2-1）!'
      //     biao = '表2-1 园区基本信息';
      //     //biaotitle='园区基本信息';
      //     tableda = this.tabledata;
      //   }
      //   else if (this.huanPingFrom.yuanQuResult.length == 0) {
      //     if (this.huanPingFrom.yuanQuName.length > 0) {
      //       this.baogao.yuanqu = ' 该项目没有落地于对应园区，兵团包含该产业的园区共有' + this.tabledata2.length + '个，详情见表2-1';/*，推荐园区名字为：*/
      //       biao = '表2-1 推荐工业园区名录';
      //       //biaotitle='推荐工业园区名录';
      //       tableda = this.tabledata2;
      //       /*for(let y in this.huanPingFrom.yuanQuName){
      //         if(y!=this.huanPingFrom.yuanQuName.length-1){
      //           this.baogao.yuanqu+=this.huanPingFrom.yuanQuName[y]+'，'
      //         }else {
      //           this.baogao.yuanqu+=this.huanPingFrom.yuanQuName[y]
      //         }
      //       }*/
      //     } else {
      //       this.baogao.yuanqu = ' 兵团级经济技术开发区均未规划该项目产业类型'
      //     }
      //   }
      // } else if (this.huanPingFrom.isYuanqu == 2) {
      //   console.log(this.huanPingFrom.categoryCondition)
      //   if (this.huanPingFrom.categoryCondition != '' && this.huanPingFrom.categoryCondition != null) {
      //     this.baogao.yuanqu = '项目' + this.huanPingFrom.categoryCondition + '，可在团场工业集聚区布局!'
      //   } else {
      //     this.baogao.yuanqu = '项目可在团场工业集聚区布局!'
      //   }
      // } else {
      //   this.baogao.yuanqu = '项目不属于工业类！'
      // }
      //环境单元
      /* if(this.DanYuanFrom.bianMa!=''){
         this.baogao.danyuan='①环境管控单元'+'\n'+'该项目所在环境管控单元基本信息及管控要求如下:'+'\n'+'  环境管控单元编码: '+this.DanYuanFrom.bianMa+'\n'+
           '    环境管控单元名称: '+this.DanYuanFrom.name+'\n'+
           '    环境管控单元区划: '+this.DanYuanFrom.shi+'-'+this.DanYuanFrom.xian+'-'+'\n'+
           '    管控单元分类: '+this.DanYuanFrom.type+'\n'+
           '    空间布局约束: '+this.DanYuanFrom.kongJianYueSu+'\n'+
           '    污染物排放管控: '+this.DanYuanFrom.wuRanWu+'\n'+
           '    环境风险防控: '+this.DanYuanFrom.huanJingFengXian+'\n'+
           '    资源开发效率要求: '+this.DanYuanFrom.ziYuanKaiFa+'\n'
         ;
       }else {
         this.baogao.danyuan='①环境管控单元'+'\n'+'无'
       }*/

      //各要素
      /*if(this.yaoSuData.length>0){
        this.baogao.yaosu='②各要素环境管控区'+'\n'+'该项目选址位于';
        for(let inx=0;inx<this.yaoSuData.length;inx++){
          if(inx!=this.yaoSuData.length-1){
            this.baogao.yaosu+=this.yaoSuData[inx].detailFeatures+'、'
          }else {
            this.baogao.yaosu+=this.yaoSuData[inx].detailFeatures
          }
        }
        var ysData=['生态','水','大气','自然资源']
        this.baogao.yaosu= this.baogao.yaosu+'。各要素环境管控区基本信息及管控要求见如下：'+'\n';
        var cedata=[this.baogao.shengtaiData,this.baogao.shuiData,this.baogao.daqiData,this.baogao.ziranData]
        for(let ys=0;ys<this.yaoSuData.length;ys++){
            this.baogao.yaosu+='  要素大类:'+ysData[ys]+'\n'+'  要素名称:'+ this.yaoSuData[ys].name+'\n'+'  要素细类:'+ this.yaoSuData[ys].detailFeatures+'\n'
          +'  环境要素管控分区名称:'+ cedata[ys][0].name+'\n'+'  环境要素管控分区编码:'+ this.baogao.shengtaiData[0].bm+'\n'
              +'  管控要求:'+'\n'+'    1.空间布局约束:'+ this.yaoSuData[ys].spaceRestrain+'\n'
              +'    2.污染物排放管控:'+ this.yaoSuData[ys].pollutantRestrain+'\n'
              +'    3.环境风险防控:'+ this.yaoSuData[ys].environmentRestrain+'\n'
              +'    4.资源开发效率要求:'+ this.yaoSuData[ys].resourceUtilization+'\n'
        }
      }*/
      this.baogao.yaosu = this.baogao.yaosu.replace(/null/g, '无');
      let docxsrc = "";
      var myDate = new Date()
      var year = myDate.getFullYear();
      var month = myDate.getMonth() + 1;
      var dt = myDate.getDate();
      /* if(tableda.length==0){
          docxsrc = "./moban2.docx";
       }else {
         docxsrc = "./moban.docx";
       }*/
      var geo = '', geonum = '', image2name = '', image3name = '', image4name = '', image5name = '';
      console.log(this.daqiTable)
      console.log(this.shengtaiTable)
      console.log(this.shuiTable)
      if (this.huanPingFrom.isYuanqu == 1 || this.huanPingFrom.isYuanqu == 2) {
        if (this.hzgeometrytype == 'line') {
          docxsrc = "./linemoban.docx";
          geo = '工程长度';
          geonum = formatLength(this.hzgeometry);
          image2name = '生态环境要素分布图';
          image3name = '水环境要素分布图';
          image4name = '大气环境要素分布图';
          image5name = '自然资源环境要素分布图';
        } else if (this.hzgeometrytype == 'reo') {
          docxsrc = "./mianmoban.docx";
          geo = '工程面积';
          geonum = formatArea(this.hzgeometry);
          image2name = '生态环境要素分布图';
          image3name = '水环境要素分布图';
          image4name = '大气环境要素分布图';
          image5name = '自然资源环境要素分布图';
        } else {
          docxsrc = "./moban.docx";
          // image2name = '生态--' + this.shengtaiTable[0].name + '分布图';
          // image3name = '水--' + this.shuiTable[0].name + '分布图';
          // image4name = '大气--' + this.daqiTable[0].name + '分布图';
          // image5name = '自然资源--' + this.ziranziyuanTable[0].name + '分布图';
          image2name = '生态环境要素分布图';
          image3name = '水环境要素分布图';
          image4name = '大气环境要素分布图';
          image5name = '自然资源环境要素分布图';
        }
      } else {
        if (this.hzgeometrytype == 'line') {
          docxsrc = "./linemoban2.docx";
          geo = '工程长度';
          geonum = formatLength(this.hzgeometry);
          image2name = '生态环境分布图';
          image3name = '水环境分布图';
          image4name = '大气环境分布图';
          image5name = '自然资源环境分布图';
        } else if (this.hzgeometrytype == 'reo') {
          docxsrc = "./mianmoban2.docx";
          geo = '工程面积';
          geonum = formatArea(this.hzgeometry);
          image2name = '生态环境分布图';
          image3name = '水环境分布图';
          image4name = '大气环境分布图';
          image5name = '自然资源环境分布图';
        } else {
          docxsrc = "./moban2.docx";
          // image2name = '生态--' + this.shengtaiTable[0].name + '分布图';
          // image3name = '水--' + this.shuiTable[0].name + '分布图';
          // image4name = '大气--' + this.daqiTable[0].name + '分布图';
          // image5name = '自然资源--' + this.ziranziyuanTable[0].name + '分布图';
          image2name = '生态环境要素分布图';
          image3name = '水环境要素分布图';
          image4name = '大气环境要素分布图';
          image5name = '自然资源环境要素分布图';
        }

      }
      var sydtrue = (syd != '');
      var shiditrue = (shidi != '');
      var shuichanzhongtrue = (shuichanzhong != '');
      var dxstrue = (dxs != '');
      var shuiqitatrue = (shuiqita != '');
      console.log(docxsrc)
      JSZipUtils.getBinaryContent(docxsrc, (err, content) => {
        if (err) {
          console.log(err)
          throw err;
        }
        //let interModelCanvas = document.getElementById(this.interModelCanvasId);
        //if (interModelCanvas) {
        // 路口模型图片
        //this.acsInfo.interImg=interModelCanvas.toDataURL();
        //}
        //interModelCanvas = undefined;
        let opts = {
          centered: false,
          getImage(tagValue, tagName) {
            return new Promise((resolve, reject) => {
              JSZipUtils.getBinaryContent(tagValue, (error, content) => {
                if (error) {
                  return reject(error);
                }
                return resolve(content);
              });
            });
          },
          getSize(img, tagValue, tagName) {
            return [590, 350];
          }
        };
        console.log(this.danYuanData)
        const imageModule = new ImageModule(opts);
        const zip = new PizZip(content);
        const doc = new Docxtemplater().loadZip(zip)
          .attachModule(imageModule).compile();
        doc.resolveData({ // 如果包含异步数据，用resolveData，在回调之后再处理，如果都是同步数据，直接用setData就可以
          name: this.baogao.project_name,
          date: year + '年' + month + '月' + dt + '日',
          longitude: this.baogao.longitude,
          latitude: this.baogao.latitude,
          longitude0: this.baogao.longitude0,
          latitude0: this.baogao.latitude0,
          longitude1: this.baogao.longitude1,
          latitude1: this.baogao.latitude1,
          geo: geo,
          geonum: geonum,
          division: this.baogao.division,
          cfirst: this.baogao.category_first,
          csecond: this.baogao.category_second,
          cthird: this.baogao.category_third,
          ifirst: this.baogao.industry_first,
          ifirst1: ifirst1,
          isecond: this.baogao.industry_second,
          shenpitype: this.baogao.shenpitype,
          chanye: this.baogao.chanye,
          chanyetrue: this.chanYeFrom.chanyeShow,
          xibu: xibu,
          sangao: sangao,
          hongxian: this.baogao.hongxian,
          syd: syd,
          sydtrue: sydtrue,
          shidi: shidi,
          shiditrue: shiditrue,
          shuichanzhong: shuichanzhong,
          shuichanzhongtrue: shuichanzhongtrue,
          dxs: dxs,
          dxstrue: dxstrue,
          shuiqita: shuiqita,
          shuiqitatrue: shuiqitatrue,
          liankong: this.baogao.liankong,
          xuqin: this.baogao.xuqin,
          yuanqu: this.baogao.yuanqu,
          biao: biao,
          biaotitle: biaotitle,
          table: tableda,
          dybm: this.danYuanData[0].dybm,
          dymc: this.danYuanData[0].dymc,
          dyfl: this.danYuanData[0].dyfl,
          dybj: this.danYuanData[0].dybj,
          dywrw: this.danYuanData[0].dywrw,
          dyhj: this.danYuanData[0].dyhj,
          dyzy: this.danYuanData[0].dyzy,
          tabledy: this.danYuanData,
          //table1:this.yaoSuData,
          tableSt: this.shengtaiTable,
          tableShui: this.shuiTable,
          tableDq: this.daqiTable,
          tableZr: this.ziranziyuanTable,
          image2name: image2name,
          image3name: image3name,
          image4name: image4name,
          image5name: image5name,
          image1: document.getElementById("tup1").src,
          image2: document.getElementById("tup2").src,
          image3: document.getElementById("tup3").src,
          image4: document.getElementById("tup4").src,
          image5: document.getElementById("tup5").src
        }).then(() => {
          try {
            doc.render();
          } catch (err) {
            console.log(errs)
            throw err;
          }
          const out = doc.getZip().generate({
            type: 'blob',
            mimeType: 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'
          });
          saveAs(out, this.baogao.project_name + "研判报告" + ".doc"); // 注意这里加下后缀，因为有些地方导出文件类型的文件，不能识别类型
        });
      });
      /* const {data:result}= await this.$http.post('/v1.0/resultIntegration/rule/export',{
           project_name:this.baogao.project_name,
           longitude:this.baogao.longitude,
           latitude:this.baogao.latitude,
           division:this.baogao.division,
           category_first:this.baogao.category_first,
           category_second:this.baogao.category_second,
           category_third:this.baogao.category_third,
           meaning:'无',
           industry_first:this.baogao.industry_first,
           industry_second:this.baogao.industry_second,
           project_content:this.baogao.shenpitype+'\n'+this.baogao.chanye+'\n'+this.baogao.xibuchanye+'\n'+this.baogao.sangaochanye,
           selection_content:this.baogao.hongxian +'\n'+this.baogao.liankong+'\n'+this.baogao.yuanqu,
           //environment_content:this.baogao.danyuan+'\n'+this.baogao.yaosu
            environment_content:'%'+document.getElementById("tup").src
       });*/
      //window.location.href = 'http://localhost:8803/'+result.data;
    },
    picchange() {
    },
    jwdzshjz(dongjingbz) {
      var d = parseInt(dongjingbz);
      var d1 = ((dongjingbz - d) * 60);
      var f = parseInt(d1);
      var m = ((d1 - f) * 60).toFixed(2);
      var dfm = d + "°" + f + "′" + m + "″";
      return dfm;
    },
    jwdzsjz(du, fen, miao) {
      return Math.abs(du) + (Math.abs(fen) / 60 + Math.abs(miao) / 3600);
    },
    hongxianChange(data) {
    },
    sydChange(data) {
    },
    sdzrChange(data) {
    },
    sczzChange(data) {
    },
    guizeSure() {
      this.baogao.hongxiantype = this.formTeDing.hxValue.label;
      this.baogao.sydtype = this.formTeDing.shuiValue.label;
      this.baogao.shiditype = this.formTeDing.shiDiValue.label;
      this.baogao.scztype = this.formTeDing.shuizhongValue.label;
      this.guiZedialogVisible = false;
    },
    sy() {
      yxLayer.setVisible(true);
      zdLayer.setVisible(true);
      ybLayer.setVisible(true);
      hxLayer.setVisible(true);
      dxLayer.setVisible(true);
      dxLayer2.setVisible(true);
      sxLayer.setVisible(true);
    },
    dy() {
      yxLayer.setVisible(true);
      zdLayer.setVisible(true);
      ybLayer.setVisible(true);
      hxLayer.setVisible(false);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(false);
    },
    st() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(true);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(false);
    },
    shui() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(false);
      dxLayer.setVisible(true);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(false);
    },
    daqi() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(false);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(true);
      sxLayer.setVisible(false);
    },
    ziran() {
      yxLayer.setVisible(false);
      zdLayer.setVisible(false);
      ybLayer.setVisible(false);
      hxLayer.setVisible(false);
      dxLayer.setVisible(false);
      dxLayer2.setVisible(false);
      sxLayer.setVisible(true);
    },
    getshenpi() {
      console.log(this.guojia)
      for (let x in this.guojia) {
        var jingdu = this.guojia[x].zuobiao[0].startLng;
        var weidu = this.guojia[x].zuobiao[0].startLat;
        console.log(jingdu)
        console.log(weidu)
        var jd0 = jingdu.substring(0, jingdu.lastIndexOf("度"));
        var jd1 = jingdu.substring(jingdu.lastIndexOf("度") + 1, jingdu.lastIndexOf("分"))
        var jd2 = jingdu.substring(jingdu.lastIndexOf("分") + 1, jingdu.lastIndexOf("秒"));
        var wd0 = weidu.substring(0, weidu.lastIndexOf("度"));
        var wd1 = weidu.substring(weidu.lastIndexOf("度") + 1, weidu.lastIndexOf("分"))
        var wd2 = weidu.substring(weidu.lastIndexOf("分") + 1, weidu.lastIndexOf("秒"));
        var zhjd = Math.abs(jd0) + (Math.abs(jd1) / 60 + Math.abs(jd2) / 3600);
        var zhwd = Math.abs(wd0) + (Math.abs(wd1) / 60 + Math.abs(wd2) / 3600);
        console.log(zhjd)
        console.log(typeof zhwd)
        var gjFeature = new Feature({
          geometry: new Point([zhjd, zhwd]), //几何信息
          name: this.guojia[x].name.name
        });
        gjFeature.setStyle(createguojiaStyle(gjFeature));
        gjSource.addFeature(gjFeature)
      }
    },
    editdialogClose() {
      this.$refs.addWzFormRef.resetFields()
    },
    editdialogClose2() {
      this.$refs.addCpFormRef.resetFields()
    },
    async addWuzi() {
      this.$refs.addWzFormRef.validate(async valid => {
        if (!valid)
          return
        const confirmResult = await this.$confirm('新增物质后非管理人员不可进行修改删除，请慎重添加，如确实要修改请联系管理人员！是否确定添加?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).catch((err) => {
          return err
        });
        this.addWzForm.lowCalorificUnit = this.addWzForm.lowCalorificUnit.value
        this.addWzForm.parentId = this.addWzForm.parentId.value
        this.addWzForm.conversionCoefficientUnit = this.addWzForm.conversionCoefficientUnit.value
        this.addWzForm.substanceUnit = this.addWzForm.substanceUnit.value
        console.log(this.addWzForm)
        const { data: res } = await this.$http.post('/v1.0/resultIntegration/rule/substanceParam/save', this.addWzForm);
        if (res.status == '6000') {
          this.$message.success('新增物质成功！')
          this.nenghaoDialogFormVisibleAdd = false;
          this.wzzhongleiChange();
        } else {
          this.$message.error('新增物质失败！' + res.message)
        }
      })
    },
    async addChanping() {
      this.$refs.addCpFormRef.validate(async valid => {
        if (!valid)
          return
        const confirmResult = await this.$confirm('新增产品后非管理人员不可进行修改删除，请慎重添加，如确实要修改请联系管理人员！是否确定添加?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).catch((err) => {
          return err
        });
        this.addCpForm.estimateAmount = this.addCpForm.estimateAmount.value
        this.addCpForm.indexUnit = this.addCpForm.indexUnit.value
        this.addCpForm.serialNum = this.addCpForm.indexUnit.substring(this.addCpForm.indexUnit.lastIndexOf("/") + 1);
        console.log(this.addCpForm)
        const { data: res } = await this.$http.post('/v1.0/resultIntegration/rule/admittanceValue/save', this.addCpForm);
        if (res.status == '6000') {
          this.$message.success('新增产品成功！')
          this.getAllproduct()
          this.nenghaoDialogFormVisibleAddcp = false;
        } else {
          this.$message.error('新增产品失败！' + res.message)
        }
      })
    }
  }
}
</script>
<style  lang="less" scoped>
.el-checkbox__label {
  font-size: 18px !important;
}

.mapMain {
  position: absolute;
  left: 15.5%;
  //height: 87%;
  top: 9.5%;
  bottom: 1.5%;
  width: 84%;
  /*background-color: #ffffff;*/

}

#map {
  float: left;
  width: 79%;
  margin-right: 0.5%;
  height: 100%;
  border-radius: 8px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: 0 0 5px #acc4fe;
}

#mapInfo {
  float: left;
  right: 0px;
  max-width: 20%;
  height: 99%;
  max-height: 99%;
  background-color: #333744;
  word-wrap: break-word;
  word-break: break-all;
  overflow: auto;
  line-height: 1
}

.param-container {
  background-color: #fff;
  padding-right: 20px;
  //color: #04F7F9;
  //border: 1px solid #526f82;
  border-radius: 45px;
}

.tlb {
  //color: #fff;
  //border: 1px solid #333;
  //box-shadow: 0 1px 2px #8b8b8b inset, 0 -1px 0 #3d3d3d inset, 0 -2px 3px #8b8b8b inset;
  //background: -webkit-linear-gradient(top, rgba(34, 34, 34, 0.49), rgba(51, 51, 51, 0.55));
  color: #4b4e53;
  font-size: 14px;
  padding-left: 3px;
  padding-right: 3px;
}

.spana {
  color: #99FF00;
  margin-right: 12px;
  font-size: 15px;
  text-decoration: none;
}

/deep/ .el-card__body {
  padding: 20px;
}

/deep/ .el-collapse-item__header {
  font-size: 16px;
  color: black;
}

/deep/ .el-tabs__item {
  padding: 0 5px;
}

/deep/.iconfont {
  margin: 0;
}

#toolcontrol {
  margin-right: 10px;

  /deep/ .el-button:focus,
  .el-button:hover {
    color: #fff;
    border-color: #c6e2ff;
    background: -webkit-linear-gradient(left, #3ee8c2, #25e4a3);
  }

  /deep/ .el-button--goon:active {
    color: #fff;
    border-color: #c6e2ff;
    outline: 0;
  }
}

#othertool {

  /deep/ .el-button:focus,
  .el-button:hover {
    color: #3ee8c2;
    //border-color: #c6e2ff;
    //background: -webkit-linear-gradient(left,#3ee8c2,#25e4a3);
  }

  /deep/ .el-button--goon:active {
    color: #3ee8c2;
    //border-color: #c6e2ff;
    outline: 0;
  }
}

.buttonstyle {
  /deep/.el-button {
    padding: 4px 15px;
  }
}

/deep/ .el-card__header {
  padding: 10px 20px;
}

/deep/ .el-card {
  border-radius: 8px;
}

#toptool {
  position: absolute;
  margin-left: 5%;
  margin-top: 1%;
}

/deep/.el-table td {
  .cell span {
    display: -webkit-box;
    text-overflow: ellipsis;
    overflow: hidden;
    -webkit-line-clamp: 8;
    -webkit-box-orient: vertical;
  }
}

/deep/ .el-input__inner {
  border-radius: 45px;
}

.projMes {
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ol-popup {
  position: absolute;
  background-color: white;
  width: 200px;
  -webkit-filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
  filter: drop-shadow(0 1px 4px rgba(0, 0, 0, 0.2));
  padding: 18px;
  padding-bottom: 5px;
  border-radius: 10px;
  border: 1px solid #cccccc;
  bottom: 12px;
  left: -50px;
  min-width: 300px;
  /* background: rgba(59,88,119,1);
    color: #04F7F9;*/
  background: rgba(255, 255, 255, 1);
  color: #000000;
}

.poptable {
  font-size: 14px;
  font-family: "\5FAE\8F6F\96C5\9ED1";
  border: 1px solid #ccc;
  border-width: 0 1px 1px 0;
  border-collapse: collapse;
  border-spacing: 0;
  background-color: transparent;
  text-align: center;
}

.poptable tr td,
.poptable tr th {
  line-height: 36px;
  font-size: 14px;
  padding: 0 8px;
  border: 1px solid #ccc;
  border-width: 1px 0 0 1px;
}

.ol-popup:after,
.ol-popup:before {
  top: 100%;
  border: solid transparent;
  content: " ";
  height: 0;
  width: 0;
  position: absolute;
  pointer-events: none;

}

.ol-popup:after {
  border-top-color: rgba(255, 255, 255, 1);
  border-width: 10px;
  left: 48px;
  margin-left: -10px;
}

.ol-popup:before {
  border-top-color: #cccccc;
  border-width: 11px;
  left: 48px;
  margin-left: -11px;
}

.ol-popup-closer {
  text-decoration: none;
  position: absolute;
  top: 2px;
  right: 8px;
}

.ol-popup-closer:after {
  content: "888";
}

.popx {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 4px 0 0;
  text-align: center;
  width: 18px;
  height: 14px;
  font: 16px/14px Tahoma, Verdana, sans-serif;
  color: #c3c3c3;
  text-decoration: none;
  font-weight: bold;
  background: transparent;
}

.demo-table-expand {
  font-size: 0;
}

.demo-table-expand label {
  width: 90px;
  color: #99a9bf;
}

.demo-table-expand .el-form-item {
  margin-right: 0;
  margin-bottom: 0;
  width: 100%;
}

/deep/ .el-dialog {
  border-radius: 8px !important;
}

/deep/ .el-select-dropdown {
  margin-left: 1.5%;
}

/deep/ .el-popper {
  margin-left: 1.5%;
}

/deep/.el-dialog__header {
  border-bottom: 1px solid #cccccc;
}

.addP {
  /deep/.el-dialog__header {
    background-image: linear-gradient(90deg, #3ee8c2 0%, #25e4a3 74%);
    border-radius: 8px 8px 0 0;
    height: 8px;
  }

  /deep/.el-dialog__headerbtn {
    top: 10px !important;
  }

  /deep/ .el-dialog__body {
    padding-top: 0px;

    /deep/ .el-form-item {
      margin-bottom: 10px !important;
    }

    /deep/ .el-form-item__label {
      font-size: 18px;
      font-weight: bold;
    }

    /deep/ .el-form-item__content {
      margin-left: 0px !important;
    }

    /deep/ .el-input__inner {
      width: 90%;
      margin-left: 5%;
    }

    /deep/ .el-select {
      /deep/ .el-input__inner {
        width: 100%;
        margin-left: 5%;
      }
    }
  }
}

.nenghao {
  /deep/.el-dialog__header {
    background-image: linear-gradient(90deg, #3ee8c2 0%, #25e4a3 74%);
    border-radius: 8px 8px 0 0;
    height: 8px;
  }

  /deep/.el-dialog__headerbtn {
    top: 10px !important;
  }

  /deep/ .el-dialog__body {
    padding-top: 0px;

    /deep/ .el-form-item {
      margin-bottom: 5px !important;
    }

    /deep/ .el-form-item__label {
      font-size: 16px;
    }

    /deep/ .el-form-item__content {
      margin-left: 0px !important;
    }

    /deep/ .el-input__inner {
      width: 90%;
      border-radius: 5px !important;
      height: 30px;
    }

    /deep/ .el-select {
      /deep/ .el-input__inner {
        width: 100%;
      }
    }
  }
}

#teDing {
  /deep/.el-dialog__header {
    background-image: linear-gradient(90deg, #3ee8c2 0%, #25e4a3 74%);
    border-radius: 8px 8px 0 0;
    height: 22px;
    text-align: center;
    padding-top: 5px;
  }

  /deep/ .el-dialog__title {
    font-size: 22px;
  }

  /deep/.el-dialog__headerbtn {
    top: 10px !important;
  }

  /deep/ .el-dialog__body {
    padding-top: 0px;

    /deep/ .el-form-item {
      margin-bottom: 10px !important;
    }

    /deep/ .el-form-item__label {
      text-align: left;
      font-size: 18px;
      font-weight: bold;
    }

    /deep/ .el-form-item__content {
      margin-left: 0px !important;
    }

    /deep/ .el-input__inner {
      width: 90%;
      margin-left: 5%;
    }

    /deep/ .el-select {
      /deep/ .el-input__inner {
        width: 100%;
        margin-left: 5%;
      }
    }
  }
}

/deep/ .el-collapse-item__wrap {
  background-color: #F7F7F7;
}

/deep/ .el-collapse-item__content {
  padding-left: 5px;
}

/deep/ #guizeInfo {
  /deep/ .cell {
    max-height: 250px;
    overflow: auto;
  }
}

.warntitle {
  /deep/ .el-alert__closebtn {
    top: 15px;
    right: 10px;
  }
}

#many {
  /deep/ .el-input__inner {
    border-radius: 0;
    padding: 0;
    height: 30px;
  }
}

::v-deep .el-dialog__title {
  font-weight: bold;
  font-size: 20px;
  color: #45524f;
}
</style>
